﻿var ComparePageObject = {
	PageDivContentID: "CarCompareContent",  // container id
	PageDivContentObj: null,   // container object
	IsDelSame: false,
	IsOperateTheSame: false,
	AllCarJson: new Array(),
	ArrPageContent: new Array(),
	ArrTempBarHTML: new Array(),
	ArrTempBarForFloatLeftHTML: new Array(),
	ArrTempLeftNavHTML: [],
	ArrLeftNavHTML: [],
	ArrTempHideLeftNavId: [],
	ArrHideLeftNavIds: [],
	FloatTop: new Array(),
	FloatLeft: new Array(),
	ValidCount: 0,
	MaxTDLeft: 5,
	NeedBlockTD: 0,
	DragID: "",
	DropID: "",
	OtherCarInterface: "http://api.car.bitauto.com/CarInfo/GetCarHotCompare.ashx?carid=",
	LastFirstInterface: Array(),
	IsCloseHotList: false,
	CreateSelectChange: new Array(),
	SelectControlTemp: "",
	BSelect: null,
	BaikeObj: null,
	IsShowFloatTop: false,
	arrCarIds: [],
	IsShowDiff: true, //差异显示
	IsVantage: true, //优势项 默认选中
	IE6: ! -[1, ] && !window.XMLHttpRequest,
	IE7: navigator.userAgent.toLowerCase().indexOf("msie 7.0") != -1,
	IsIE: (navigator.appName == "Microsoft Internet Explorer"),
	IsChange: false
}

function initPageForCompare() {
	intiSelectControl();
	if (document.getElementById(ComparePageObject.PageDivContentID))
	{ ComparePageObject.PageDivContentObj = $("#" + ComparePageObject.PageDivContentID); }
	if (typeof (carCompareJson) != "undefined" && carCompareJson != null)
	{ ComparePageObject.AllCarJson = carCompareJson; }
	ComparePageObject.ValidCount = ComparePageObject.AllCarJson.length;
	ComparePageObject.NeedBlockTD = ComparePageObject.ValidCount >= 5 ? 1 : 5 - ComparePageObject.ValidCount;
	if (ComparePageObject.ValidCount == 10)
	{ ComparePageObject.NeedBlockTD = 0; }
	var hash = window.location.hash;
	if (hash.indexOf("&vantage") != -1) ComparePageObject.IsVantage = true;
	if (hash.indexOf("&diff") != -1) ComparePageObject.IsOperateTheSame = true;
	if (hash.indexOf("&showdiff") != -1) ComparePageObject.IsShowDiff = true;
	//初始化 左上角多选框选中状态
	if (ComparePageObject.IsVantage)
		$("#smallfixed input[name='chkAdvantage']").attr("checked", true);
	if (ComparePageObject.IsOperateTheSame)
		$("#smallfixed input[name='checkboxForDelTheSame']").attr("checked", true);
	if (ComparePageObject.IsShowDiff)
		$("#smallfixed input[name='checkboxForDiff']").attr("checked", true);

	checkIsCloseHotCompare();
	createPageForCompare(ComparePageObject.IsOperateTheSame);


	//添加滚动监听事件
	$('[data-spy="scroll"]').each(function () {
		var $spy = $(this);
		$spy.scrollspy($spy.data(), function () { scrollCallback(); });
	});
}

//构建空表格数据
function createEmptyTable() {
	var flag = false;
	for (var i = 0; i < arrField.length; i++) {
		if (arrField[i].sType == "bar" && arrField[i]["sFieldTitle"] == "车体") break;
		if (arrField[i].sType == "bar" && arrField[i]["sFieldTitle"] == "基本信息") {
			var arrFieldRow = arrField[i];
			flag = true;
			ComparePageObject.ArrPageContent.push("<tr id=\"" + arrFieldRow.scrollId + "\"><td class=\"pd0\" colspan=\"" + (ComparePageObject.MaxTDLeft + 1) + "\"><h2><span>基本信息</span></h2></td></tr>");
		}
		ComparePageObject.ArrPageContent.push("<tr>");
		if (arrField[i].sType == "fieldPara" && flag) {
			var arrFieldRow = arrField[i];
			ComparePageObject.ArrPageContent.push("<th>" + checkBaikeForTitle(arrFieldRow) + "</th>");
			for (var j = 0; j < ComparePageObject.MaxTDLeft; j++) {
				ComparePageObject.ArrPageContent.push("<td name=\"td" + j + "\"></td>");
			}
		}
		ComparePageObject.ArrPageContent.push("</tr>");
	}
}
function createPageForCompare(isDelSame) {
	//	if (ComparePageObject.ValidCount > 0) {
	//		$("#ListForCompare").hide();
	//	}
	//	else {
	//		pageSelectTagForList(3);
	//		$("#ListForCompare").show();
	//		$("#left-nav").hide();
	//	}
	if (ComparePageObject.ValidCount <= 0) {
		$("#left-nav").hide();
	}
	ComparePageObject.IsDelSame = isDelSame;
	var loopCount = arrField.length;
	ComparePageObject.ArrPageContent.push("<table cellspacing=\"0\" cellpadding=\"0\"><tbody>");
	for (var i = 0; i < loopCount; i++) {
		switch (arrField[i].sType) {
			case "fieldPara":
				if (ComparePageObject.ValidCount > 0) createPara(arrField[i]);
				break;
			case "fieldMulti":
				if (ComparePageObject.ValidCount > 0) createMulti(arrField[i]);
				break;
			case "bar":
				if (ComparePageObject.ValidCount > 0) createBar(arrField[i]);
				break;
			case "fieldPrice":
				if (ComparePageObject.ValidCount > 0) createPrice(arrField[i]);
				break;
			case "fieldPic":
				createPic();
				break;
			case "fieldOther":
				if (ComparePageObject.ValidCount > 0) createOther(arrField[i]);
				break;
			case "fieldIndex":
				if (ComparePageObject.ValidCount > 0) createIndex(arrField[i]);
				break;
		}
	}
	//创建空数据
	if (ComparePageObject.ValidCount <= 0) createEmptyTable();

	ComparePageObject.ArrPageContent.push("</tbody></table>");
	// end
	if (ComparePageObject.PageDivContentObj) {
		ComparePageObject.PageDivContentObj.html(ComparePageObject.ArrPageContent.join(""));
	}
	ComparePageObject.ArrPageContent.length = 0;
	// set img drag
	setImgDrag();
	if (!ComparePageObject.IsCloseHotList) {
		ajaxOtherCarList();
	}
	bindSelectForCompare();
	changeWhenFloatTop();
	if (ComparePageObject.ValidCount > 0) {
		$("#leftfixed").html("<table cellpadding=\"0\" cellspacing=\"0\" class=\"floatTable\">" + ComparePageObject.FloatLeft.join("") + "</table>");
		ComparePageObject.FloatLeft.length = 0;
	}
	//填充左侧滚动菜单
	if (ComparePageObject.ValidCount > 0) {
		$("#left-nav ul").html(ComparePageObject.ArrLeftNavHTML.join('')).find("li:last").addClass("last").show();
		ComparePageObject.ArrLeftNavHTML.length = 0;
	}

	//alert(ComparePageObject.ArrHideLeftNavIds.join(''));
	//$("#left-nav li a[data-target='" + n + "'").closest("li").hide();

	ComparePageObject.ArrHideLeftNavIds.length = 0;
	changeCheckBoxStateByName("checkboxForDelTheSame", ComparePageObject.IsOperateTheSame);
	setTRColorWhenMouse();

	//绑定事件
	bindEvent();
}

//绑定事件
function bindEvent() {
	//纠错
	var strError = "车款名称：\n问题描述：\n联系方式(电话/QQ)：";
	$("a[name='correcterror']").click(function () { $(".popup-correct-error").showCenter(); $("#correctError").val(strError); });
	$(".popup-correct-error .btn-close-car").click(function () { $(".popup-correct-error").hide(); });
	$(".popup-success .btn-close-car").click(function () { $(".popup-success").hide(); });
	$(".popup-correct-error a[name='btnCorrectError']").click(function (e) {
		e.preventDefault();
		var content = $("#correctError").val();
		if (content == "" || content == strError) {
			$(".popup-correct-error .alert span").html("请输入提交内容。");
			return;
		} $(".popup-correct-error .alert span").html("");
		var url = "http://www.bitauto.com/FeedBack/api/CommentNo.ashx?txtContent=" + encodeURIComponent(content) + "&satisfy=1&ProductId=5&categorytype=2";
		$.ajax({ url: url, dataType: 'jsonp', jsonp: "XSS_HTTP_REQUEST_CALLBACK", jsonpCallback: "errorCallback", success: function (data) {
			if (data.status == "success") {
				$(".popup-correct-error").hide();
				$(".popup-success").showCenter().find(".popup-success-item h4").html("提交成功！").siblings("p").html("侦察兵，好样的！");
			} else {
				$(".popup-success").showCenter().find(".popup-success-item h4").html("提交失败！").siblings("p").html(data.message);
			}
		}
		});
	});
	//左侧隐藏按钮
	$(".btn-show-left-nav").click(function () { $("#left-nav").show().addClass("left-nav-horizontal"); $(".btn-hide-left-nav").show(); $(this).hide(); });
	//菜单隐藏按钮
	$(".btn-hide-left-nav").click(function () { $("#left-nav").removeClass("left-nav-horizontal"); $(this).hide(); $(".btn-show-left-nav").show(); });

	//添加滚动监听事件
	$('[data-spy="scroll"]').each(function () {
		var $spy = $(this);
		$spy.scrollspy($spy.data(), function () { scrollCallback(); });
		$spy.scrollspy("refresh");
	});
	//元素切换效果
	//$("div[id^='tableHead_']").clickChange({ "leftCallback": moveLeftForCarCompare, "rightCallback": moveRightForCarCompare });
	$(".tableHead_item").clickChange({ "leftCallback": moveLeftForCarCompare, "rightCallback": moveRightForCarCompare });
	if (ComparePageObject.ValidCount <= 0) {
		$("#left-nav").hide();
		$(window).scrollTop(0);
	} else {
		$("#left-nav").show();
	}
	//点击空白 换车 推荐 弹出层隐藏
	$(document).click(function (e) {
		//e.preventDefault();
		e = e || window.event;
		var target = e.srcElement || e.target;
		//console.log(($(target).closest(".popup-change-car").length <= 0));
		//console.log((target.id != undefined && target.id.indexOf("change_car_") == -1));
		//换车
		if (($(target).closest(".popup-change-car").length <= 0) && ($(target).closest("a[id^='change_car_']").length <= 0)) {
			$(".change-car-area a[id^='change_car_']").attr("class", "btn-show-car").siblings(".popup-change-car").hide();
		}
		//为我推荐
		if ($(target).closest(".popup-recom").length <= 0 && ($(target).closest(".btn-hide-car").length <= 0)) {
			$(".recom-car > a:first-child").attr("class", "btn-show-car").siblings(".popup-recom").hide();
		}
	});
}
//已选车款不可选
function setCarDisabled() {
	for (var i = 0; i < ComparePageObject.ValidCount; i++) {
		var carId = ComparePageObject.AllCarJson[i][0][0];
		$("#cartype4 .popup-box .select-list a[bita-value='" + carId + "']").unbind("click").addClass("none");
		$("div[id^='CarTypeSelectList_'] .popup-box .select-list a[bita-value='" + carId + "']").unbind("click").addClass("none");
	}
}
// create pic for compare
function createPic() {
	// for FloatTop
	ComparePageObject.FloatTop.length = 0;
	ComparePageObject.FloatTop.push("<table cellpadding=\"0\" cellspacing=\"0\">");
	ComparePageObject.FloatTop.push("<tr>");
	ComparePageObject.FloatTop.push("<th class=\"pd0\">");
	ComparePageObject.FloatTop.push("<div class=\"tableHead_left\">");


	//ComparePageObject.FloatTop.push("<input type=\"checkbox\" name=\"checkboxForDelTheSame\" onclick=\"delTheSameForCompare();\" id=\"checkDifferFloatTop\">");
	//ComparePageObject.FloatTop.push("<label for=\"checkDifferFloatTop\">高亮不同项</label>");

	ComparePageObject.FloatTop.push("<div class=\"check-box-item\"><input type=\"checkbox\" name=\"chkAdvantage\" onclick=\"advantageForCompare();\" " + (ComparePageObject.IsVantage ? "checked" : "") + "> <label for=\"chkAdvantage\">标识优势项 <em></em></label></div>");
	ComparePageObject.FloatTop.push("<div class=\"check-box-item\"><input type=\"checkbox\" name=\"checkboxForDiff\" onclick=\"showDiffForCompare();\" " + (ComparePageObject.IsShowDiff ? "checked" : "") + "> <label for=\"checkboxForDiff\">高亮不同项</label></div>");
	ComparePageObject.FloatTop.push("<div class=\"check-box-item\"><input type=\"checkbox\" name=\"checkboxForDelTheSame\" onclick=\"delTheSameForCompare();\" > <label for=\"checkDiffer\">隐藏相同项</label></div>");

	ComparePageObject.FloatTop.push("<div class=\"dashline\"></div>");
	ComparePageObject.FloatTop.push("<p>●标配 ○选配&nbsp;&nbsp;- 无</p>");
	ComparePageObject.FloatTop.push("</div>");
	ComparePageObject.FloatTop.push("</th>");

	// for FloatLeft
	ComparePageObject.FloatLeft.length = 0;
	ComparePageObject.FloatLeft.push("<tr>");
	ComparePageObject.FloatLeft.push("<td class=\"pd0\">");
	ComparePageObject.FloatLeft.push("<div class=\"tableHead_left\">");
	ComparePageObject.FloatLeft.push("<dl>");
	ComparePageObject.FloatLeft.push("<dt>对比车型</dt>");
	ComparePageObject.FloatLeft.push("<dd>拖拽车款图片可调顺序</dd>");
	ComparePageObject.FloatLeft.push("</dl>");

	//ComparePageObject.FloatLeft.push("<input type=\"checkbox\" name=\"checkboxForDelTheSame\" onclick=\"delTheSameForCompare();\" id=\"checkDifferFloatLeft\">");
	//ComparePageObject.FloatLeft.push("<label for=\"checkDifferFloatLeft\">高亮不同项</label>");

	ComparePageObject.FloatLeft.push("<div class=\"check-box-item\"><input type=\"checkbox\" id=\"chkAdvantage\" name=\"chkAdvantage\" onclick=\"advantageForCompare();\" " + (ComparePageObject.IsVantage ? "checked" : "") + "> <label for=\"chkAdvantage\">标识优势项 <em></em></label></div>");
	ComparePageObject.FloatLeft.push("<div class=\"check-box-item\"><input type=\"checkbox\" name=\"checkboxForDiff\" onclick=\"showDiffForCompare();\" id=\"checkboxForDiff\" " + (ComparePageObject.IsShowDiff ? "checked" : "") + "> <label for=\"checkboxForDiff\">高亮不同项</label></div>");
	ComparePageObject.FloatLeft.push("<div class=\"check-box-item\"><input type=\"checkbox\" name=\"checkboxForDelTheSame\" onclick=\"delTheSameForCompare();\" id=\"checkDiffer\"> <label for=\"checkDiffer\">隐藏相同项</label></div>");




	ComparePageObject.FloatLeft.push("<div class=\"dashline\"></div>");
	ComparePageObject.FloatLeft.push("<p>●标配 ○选配&nbsp;&nbsp;- 无</p>");
	ComparePageObject.FloatLeft.push("</div>");
	ComparePageObject.FloatLeft.push("</td>");
	ComparePageObject.FloatLeft.push("</tr>");
	// ComparePageObject.FloatLeft.push("<tr id=\"trOtherCarListForFloatLeft\"></tr>");

	ComparePageObject.ArrPageContent.push("<tr id=\"trForPic\">");
	var classNameAdd = "";
	if (!ComparePageObject.IsCloseHotList) {
		// classNameAdd = " bdbottomnone";
	}
	ComparePageObject.ArrPageContent.push("<th class=\"pd0" + classNameAdd + "\">");
	ComparePageObject.ArrPageContent.push("<div class=\"tableHead_left\">");
	ComparePageObject.ArrPageContent.push("<dl><dt>对比车型</dt><dd>拖拽车款图片可调顺序</dd></dl>");

	ComparePageObject.ArrPageContent.push("<div class=\"check-box-item\"><input type=\"checkbox\" name=\"chkAdvantage\" onclick=\"advantageForCompare();\" " + (ComparePageObject.IsVantage ? "checked" : "") + "> <label for=\"chkAdvantage\">标识优势项 <em></em></label></div>");
	ComparePageObject.ArrPageContent.push("<div class=\"check-box-item\"><input type=\"checkbox\" name=\"checkboxForDiff\" onclick=\"showDiffForCompare();\" " + (ComparePageObject.IsShowDiff ? "checked" : "") + "> <label for=\"checkboxForDiff\">高亮不同项</label></div>");
	ComparePageObject.ArrPageContent.push("<div class=\"check-box-item\"><input type=\"checkbox\" name=\"checkboxForDelTheSame\" onclick=\"delTheSameForCompare();\"> <label for=\"checkDiffer\">隐藏相同项</label></div>");


	//ComparePageObject.ArrPageContent.push("<input type=\"checkbox\" name=\"checkboxForDelTheSame\" onclick=\"delTheSameForCompare();\" id=\"checkDiffer\"> <label for=\"checkDiffer\">高亮不同项</label>");
	ComparePageObject.ArrPageContent.push("<div class=\"dashline\"></div>");
	ComparePageObject.ArrPageContent.push("<p>●标配 ○选配&nbsp;&nbsp;- 无</p></div>");
	ComparePageObject.ArrPageContent.push("</th>");

	for (var i = 0; i < ComparePageObject.ValidCount; i++) {
		ComparePageObject.ArrPageContent.push("<td class=\"pd0" + classNameAdd + "\" name=\"td" + i + "\" id=\"td_" + i + "\" style=\"position:relative; z-index:" + (10 - i) + "\" >");
		if (i == 0)
		{ ComparePageObject.ArrPageContent.push("<div id=\"tableHead_" + i + "\" class=\"tableHead_item\">"); }
		else
		{ ComparePageObject.ArrPageContent.push("<div id=\"tableHead_" + i + "\" class=\"tableHead_item\">"); }
		ComparePageObject.ArrPageContent.push("<div class=\"sel-car-box\" id=\"carBox_" + i + "\">");
		var pic = ComparePageObject.AllCarJson[i][0][2] || "";
		pic == "" ? "http://image.bitautoimg.com/autoalbum/V2.1/images/120-80.gif" : pic;
		//ComparePageObject.ArrPageContent.push("<div name=\"hasCarBox\" id=\"carBox_" + i + "\" class=\"carBox\">");

		ComparePageObject.ArrPageContent.push("<div style=\"height:153px\">");
		ComparePageObject.ArrPageContent.push("<div id=\"draggcarbox_" + i + "\" class=\"sel-car-move\">");
		ComparePageObject.ArrPageContent.push("<img id=\"imgdrag_" + i + "\" name=\"imgdrag\" alt=\"按住鼠标左键，可拖动到其他列\" src=\"" + pic + "\">");
		ComparePageObject.ArrPageContent.push("<dl><dt><a target=\"_blank\" href=\"/" + ComparePageObject.AllCarJson[i][0][6] + "/\">" + ComparePageObject.AllCarJson[i][0][5] + "</a></dt>");

		var yearType = ComparePageObject.AllCarJson[i][0][7];
		ComparePageObject.ArrPageContent.push("<dd><a target=\"_blank\" href=\"/" + ComparePageObject.AllCarJson[i][0][6] + "/m" + ComparePageObject.AllCarJson[i][0][0] + "/\">" + ((yearType == "" || yearType == 0) ? "" : "" + yearType + "款 ") + ComparePageObject.AllCarJson[i][0][1] + "</a></dd>");
		ComparePageObject.ArrPageContent.push("</dl>");
		ComparePageObject.ArrPageContent.push("</div>");
		ComparePageObject.ArrPageContent.push("</div>");

		ComparePageObject.ArrPageContent.push("<div class=\"change-car-area\">");

		// for FloatTop
		ComparePageObject.FloatTop.push("<td class=\"pd0\" style=\"position:relative; z-index:" + (10 - i) + "\" >");
		ComparePageObject.FloatTop.push("<div id=\"FloatTop_tableHead_" + i + "\" class=\"tableHead_item\">");
		ComparePageObject.FloatTop.push("<div class=\"sel-car-box\">");
		ComparePageObject.FloatTop.push("<div class=\"dl-box\"><div  id=\"FloatTop_carBox_" + i + "\" class=\"dl-box\">");
		ComparePageObject.FloatTop.push("<dl><dt><a target=\"_blank\" href=\"/" + ComparePageObject.AllCarJson[i][0][6] + "/\">" + ComparePageObject.AllCarJson[i][0][5] + "</a></dt>");
		ComparePageObject.FloatTop.push("<dd><a target=\"_blank\" href=\"/" + ComparePageObject.AllCarJson[i][0][6] + "/m" + ComparePageObject.AllCarJson[i][0][0] + "/\">" + ((yearType == "" || yearType == 0) ? "" : "" + yearType + "款 ") + ComparePageObject.AllCarJson[i][0][1] + "</a></dd>");
		var referPrice = ComparePageObject.AllCarJson[i][1][0];
		if (referPrice != "无") {
			ComparePageObject.FloatTop.push("<dd class=\"car-price\"><a target=\"_blank\" href=\"/" + ComparePageObject.AllCarJson[i][0][6] + "/m" + ComparePageObject.AllCarJson[i][0][0] + "/baojia/\">" + ComparePageObject.AllCarJson[i][1][0] + "</a> (厂家指导价)</dd>");
		}
		ComparePageObject.FloatTop.push("</dl>");
		ComparePageObject.FloatTop.push("</div></div>");
		ComparePageObject.FloatTop.push("<div id=\"FloatTop_OptArea_" + i + "\" class=\"change-car-area\">");

		if (i > 0) {
			//ComparePageObject.ArrPageContent.push("<a class=\"btn-pre-car\" href=\"javascript:moveLeftForCarCompare('" + i + "');\"></a>");
			ComparePageObject.ArrPageContent.push("<a class=\"btn-pre-car\" href=\"javascript:;\" title=\"左移\"></a>");
			// for FloatTop
			//ComparePageObject.FloatTop.push("<a class=\"btn-pre-car\" href=\"javascript:moveLeftForCarCompare('" + i + "');\"></a>");
			ComparePageObject.FloatTop.push("<a class=\"btn-pre-car\" href=\"javascript:;\" title=\"左移\"></a>");
		}
		// else {
		//		if (ComparePageObject.IsCloseHotList) {


		//ComparePageObject.ArrPageContent.push("<a id=\"pkButton_" + i + "\" class=\"pk\" href=\"javascript:showHotCompare(" + i + ");\">pk</a>");
		//		}
		//		else {
		//			ComparePageObject.ArrPageContent.push("<a style=\"display:none;\" id=\"pkButton_" + i + "\" class=\"pk\" href=\"javascript:showHotCompare(" + i + ");\">pk</a>");
		//		}
		// }

		ComparePageObject.ArrPageContent.push("<a id=\"change_car_" + i + "\" class=\"btn-show-car\" href=\"javascript:setSelectControlForCompare('tableHead_" + i + "','HeadTemp')\"><span>换辆车</span></a>");





		// for FloatTop
		ComparePageObject.FloatTop.push("<a id=\"change_car_float_" + i + "\" class=\"btn-show-car\" href=\"javascript:setSelectControlForCompare('FloatTop_tableHead_" + i + "','Float_HeadTemp')\"><span>换辆车</span></a>");



		if (i != ComparePageObject.ValidCount - 1) {
			//ComparePageObject.ArrPageContent.push("<a class=\"btn-next-car\" href=\"javascript:moveRightForCarCompare('" + i + "');\"></a>");
			ComparePageObject.ArrPageContent.push("<a class=\"btn-next-car\" href=\"javascript:;\" title=\"右移\"></a>");
			// for FloatTop
			//ComparePageObject.FloatTop.push("<a class=\"btn-next-car\" href=\"javascript:moveRightForCarCompare('" + i + "');\"></a>");
			ComparePageObject.FloatTop.push("<a class=\"btn-next-car\" href=\"javascript:;\" title=\"右移\"></a>");
		}
		ComparePageObject.ArrPageContent.push("</div>");
		//		if (i == 0) {
		//			ComparePageObject.ArrPageContent.push("<div class=\"sx\">首选车型</div>");
		//		}
		ComparePageObject.ArrPageContent.push("<a class=\"btn-close-car\" title=\"删除\" href=\"javascript:;\" onclick=\"delCarToCompare('" + i + "',event);\">删除</a>");


		ComparePageObject.ArrPageContent.push("</div>");
		ComparePageObject.FloatTop.push("</div>");
		ComparePageObject.FloatTop.push("<a class=\"btn-close-car\" title=\"删除\" href=\"javascript:;\" onclick=\"delCarToCompare('" + i + "',event);\">删除</a>");
		ComparePageObject.ArrPageContent.push("</div>");
		if (i == 0) {
			//ComparePageObject.ArrPageContent.push("<div style=\"display:none;\" class=\"firstCar_pop\" id=\"firstCar_pop\"></div>");
		}
		ComparePageObject.ArrPageContent.push("</td>");

		// for FloatTop
		ComparePageObject.FloatTop.push("</div>");
		ComparePageObject.FloatTop.push("</td>");
	}

	//when less 
	if (ComparePageObject.NeedBlockTD > 0) {
		for (var i = 0; i < ComparePageObject.NeedBlockTD; i++) {
			var index = (ComparePageObject.ValidCount + i);
			ComparePageObject.ArrPageContent.push("<td class=\"pd0" + classNameAdd + "\" style=\"position:relative; z-index:" + (ComparePageObject.NeedBlockTD - i) + "\">");
			if (i == 0) {
				ComparePageObject.ArrPageContent.push("<div id=\"tableHead_" + index + "\" class=\"tableHead_item\" bit-disabled=\"\">");
			}
			else {
				ComparePageObject.ArrPageContent.push("<div id=\"tableHead_" + index + "\" class=\"tableHead_item noBg\">");
			}
			ComparePageObject.ArrPageContent.push("<div class=\"top-txt\">车款" + (index + 1) + "</div>");
			//ComparePageObject.ArrPageContent.push("<div id=\"TopSelect\" class=\"carBox\">");
			//ComparePageObject.ArrPageContent.push("<img alt=\"按住鼠标左键，可拖动到其他列\" src=\"http://image.bitautoimg.com/autoalbum/V2.1/images/120-80.gif\">");

			if (i == 0) {
				ComparePageObject.ArrPageContent.push("<div id=\"master4\" class=\"sel-item-box\" style=\"z-index: 50\"></div>");
				ComparePageObject.ArrPageContent.push("<div id=\"serial4\" class=\"sel-item-box\" style=\"z-index: 40\"></div>");
				ComparePageObject.ArrPageContent.push("<div id=\"cartype4\" class=\"sel-item-box\" style=\"z-index: 30\"></div>");
				if (index > 0)
					ComparePageObject.ArrPageContent.push("<div class=\"recom-car\"><a href=\"javascript:recomCarList('tableHead_" + index + "'," + (index - 1) + ");\" class=\"btn-show-car\"><span>为我推荐</span></a></div>");

				// for FloatTop
				ComparePageObject.FloatTop.push("<td class=\"pd0\" style=\"position:relative; z-index:" + (ComparePageObject.NeedBlockTD - i) + "\">");
				ComparePageObject.FloatTop.push("<div id=\"FloatTop_tableHead_" + index + "\" class=\"tableHead_item\" bit-disabled=\"\">");

				//				ComparePageObject.FloatTop.push("<div id=\"FloatTop_selectForMaster\"></div>");
				//				ComparePageObject.FloatTop.push("<div id=\"FloatTop_selectForSerial\"></div>");
				//				ComparePageObject.FloatTop.push("<div id=\"FloatTop_selectForCar\"></div>");

				ComparePageObject.FloatTop.push("<div class=\"recom-car\"><a href=\"javascript:recomCarList('FloatTop_tableHead_" + index + "'," + (index - 1) + ");\" class=\"btn-show-car\"><span>为我推荐</span></a></div>");
				//				ComparePageObject.FloatTop.push("<div id=\"FloatTopSelect\" class=\"carBox\">");
				//				ComparePageObject.FloatTop.push("</div>");
				ComparePageObject.FloatTop.push("</div>");
				ComparePageObject.FloatTop.push("</td>");
			}
			else {
				ComparePageObject.ArrPageContent.push("<div class=\"sel-item-box\" style=\"z-index: 50\"><span class=\"sel-item sel-item-disabled\"><span>请选择品牌</span><em></em></span></div>");
				ComparePageObject.ArrPageContent.push("<div class=\"sel-item-box\" style=\"z-index: 40\"><span class=\"sel-item sel-item-disabled\"><span>请选择车型</span><em></em></span></div>");
				ComparePageObject.ArrPageContent.push("<div class=\"sel-item-box\" style=\"z-index: 30\"><span class=\"sel-item sel-item-disabled\"><span>请选择车款</span><em></em></span></div>");
				//ComparePageObject.ArrPageContent.push("<select disabled=\"disabled\" class=\"top105 car_select_w\"><option>选择品牌</option></select>");
				//ComparePageObject.ArrPageContent.push("<select disabled=\"disabled\" class=\"top130 car_select_w\"><option>选择车型</option></select>");
				//ComparePageObject.ArrPageContent.push("<select disabled=\"disabled\" class=\"top155 car_select_w\" ><option>选择车款</option></select>");

				// for FloatTop
				ComparePageObject.FloatTop.push("<td class=\"pd0\"><div class=\"tableHead_item noBg\">");
				ComparePageObject.FloatTop.push("<div class=\"carBox\"><div class=\"sel-item-box\" style=\"z-index: 50\"><span class=\"sel-item sel-item-disabled\"><span>请选择品牌</span><em></em></span></div><div class=\"sel-item-box\" style=\"z-index: 40\"><span class=\"sel-item sel-item-disabled\"><span>请选择车型</span><em></em></span></div><div class=\"sel-item-box\" style=\"z-index: 30\"><span class=\"sel-item sel-item-disabled\"><span>请选择车款</span><em></em></span></div></div>");
				ComparePageObject.FloatTop.push("</div></td>");
			}
			ComparePageObject.ArrPageContent.push("</div></td>");
		}
	}
	ComparePageObject.ArrPageContent.push("</tr>");

	ComparePageObject.FloatTop.push("</tr>");
	ComparePageObject.FloatTop.push("</table>");
	$("#topfixed").html(ComparePageObject.FloatTop.join(""));
}

function changeWhenFloatTop() {
	if (ComparePageObject.IsShowFloatTop) {
		// show the Float Top
		if (ComparePageObject.AllCarJson.length > 0) {
			$("#master4,#serial4,#cartype4").prependTo("div[id^='FloatTop_tableHead_'][bit-disabled]");
			//			if (ComparePageObject.ValidCount > 0) {
			//				for (var i = 0; i < ComparePageObject.ValidCount; i++) {
			//					if (!document.getElementById("MasterSelectList_HeadTemp_" + i)
			//					|| document.getElementById("MasterSelectList_HeadTemp_" + i) == null)
			//					{ continue; }
			//					// if (typeof (document.getElementById("MasterSelectList_HeadTemp_" + i) != "undefined")) {
			//					// current change state
			//					$("#FloatTop_carBox_" + i + " dl").hide();
			//					$("#MasterSelectList_HeadTemp_" + i).appendTo("#FloatTop_carBox_" + i);
			//					$("#SerialSelectList_HeadTemp_" + i).appendTo("#FloatTop_carBox_" + i);
			//					$("#CarTypeSelectList_HeadTemp_" + i).appendTo("#FloatTop_carBox_" + i);
			//					// $("#FloatTop_OptArea_" + i).hide();
			//					$("#FloatTop_OptArea_" + i).empty();
			//				}
			//			}
			//		}
		}
		else {
			// hide the Float Top
			if (ComparePageObject.AllCarJson.length > 0) {

				//			if (ComparePageObject.ValidCount > 0) {
				//			if (ComparePageObject.ValidCount > 0) {
				//				for (var i = 0; i < ComparePageObject.ValidCount; i++) {
				//					if (!document.getElementById("MasterSelectList_HeadTemp_" + i)
				//					|| document.getElementById("MasterSelectList_HeadTemp_" + i) == null)
				//					{ continue; }
				//					// if (typeof (document.getElementById("MasterSelectList_HeadTemp_" + i) != "undefined")) {
				//					// current change state
				//					$("#FloatTop_carBox_" + i + " dl").show();
				//					$("#MasterSelectList_HeadTemp_" + i).appendTo("#carBox_" + i);
				//					$("#SerialSelectList_HeadTemp_" + i).appendTo("#carBox_" + i);
				//					$("#CarTypeSelectList_HeadTemp_" + i).appendTo("#carBox_" + i);
				//					$("#FloatTop_OptArea_" + i).show();
				//					// }
				//				}
				//			}
			}
		}
	} else {
		$("#master4,#serial4,#cartype4").insertBefore("div[id^='tableHead_'][bit-disabled] .recom-car");
	}
}

// create bar for compare
function createBar(arrFieldRow) {
	ComparePageObject.ArrTempBarHTML.length = 0;
	ComparePageObject.ArrTempBarForFloatLeftHTML.length = 0;
	ComparePageObject.ArrTempLeftNavHTML.length = 0;

	if (ComparePageObject.ValidCount > 0) {
		ComparePageObject.ArrTempBarHTML.push("<tr id=\"" + arrFieldRow["scrollId"] + "\">");
		var summaryColumn = 0;
		if (ComparePageObject.ValidCount < 5)
		{ summaryColumn = 6; }
		else
		{ summaryColumn = ComparePageObject.ValidCount + 2; }
		ComparePageObject.ArrTempBarHTML.push("<td class=\"pd0\" colspan=\"" + summaryColumn + "\">");
		ComparePageObject.ArrTempBarHTML.push("<h2><span>" + arrFieldRow["sFieldTitle"] + "<a href=\"javascript:;\" name=\"correcterror\">参数纠错</a></span></h2>");
		ComparePageObject.ArrTempBarHTML.push("</td>");
		ComparePageObject.ArrTempBarHTML.push("</tr>");

		ComparePageObject.ArrTempBarForFloatLeftHTML.push("<tr>");
		ComparePageObject.ArrTempBarForFloatLeftHTML.push("<td class=\"pd0\"><h2><span>" + arrFieldRow["sFieldTitle"] + "<a href=\"javascript:;\" name=\"correcterror\">参数纠错</a></span></h2></td>");
		ComparePageObject.ArrTempBarForFloatLeftHTML.push("</tr>");
		//左侧菜单数据
		ComparePageObject.ArrTempLeftNavHTML.push("<li class=\"" + (arrFieldRow["sFieldTitle"] == "基本信息" ? "current" : "") + "\"><a data-target=\"" + arrFieldRow["scrollId"] + "\" href=\"javascript:;\" >" + arrFieldRow["sFieldTitle"] + "</a></li>");
		//ComparePageObject.ArrTempHideLeftNavId.push(arrFieldRow["scrollId"]);
	}
	if (ComparePageObject.ArrTempBarForFloatLeftHTML.length > 0) {
		ComparePageObject.FloatLeft.push(ComparePageObject.ArrTempBarForFloatLeftHTML.join(""));
		ComparePageObject.ArrTempBarForFloatLeftHTML.length = 0;
	}
}

// create param for compare
function createPara(arrFieldRow) {
	var firstSame = true,
	isAllunknown = true,
	arrSame = [],
	arrTemp = [],
	isShowLoop = 0;

	var chkResult = { IsSame: true, CurrCarIndex: 0, CurrParamsValue: 0 };
	var vantage = (ComparePageObject.IsVantage && arrFieldRow["isVantage"] && arrFieldRow["isVantage"] == "1");
	if (vantage || ComparePageObject.IsShowDiff)
		chkResult = IsFieldSame(arrFieldRow);


	for (var i = 0; i < ComparePageObject.ValidCount; i++) {
		if (ComparePageObject.AllCarJson[i]) {
			if (!chkResult.IsSame && ComparePageObject.IsShowDiff)
				arrTemp.push("<td name=\"td" + i + "\" class=\"bg-blue\">");
			else if (!chkResult.IsSame && vantage && chkResult.CurrCarIndex != -1) {
				arrTemp.push("<td name=\"td" + i + "\" class=\"bg-blue\">");
			}
			else
				arrTemp.push("<td name=\"td" + i + "\" >");
			try {
				var sTrPrefix = arrFieldRow["sTrPrefix"];
				var index = arrFieldRow["sFieldIndex"];
				if (ComparePageObject.AllCarJson[i].length <= sTrPrefix)
				{ return; }
				if (ComparePageObject.AllCarJson[i][sTrPrefix].length <= index)
				{ return; }
				var field = ComparePageObject.AllCarJson[i][sTrPrefix][index] || "";
				if (field == "待查")
				{ field = ""; }
				//				if (field.length > 0) {
				//					if (arrFieldRow["unit"] != "") {
				//						field += "" + arrFieldRow["unit"];
				//					}
				//				}
				if (arrSame.length < 1) {
					arrSame.push(field);
				}
				else {
					if (field == arrSame[0])
					{ firstSame = firstSame && true; }
					else
					{ firstSame = firstSame && false; }
				}
				if (field.indexOf("待查") >= 0 || field == "") {
					isAllunknown = true && isAllunknown;
				}
				else {
					isAllunknown = false;
				}
				if (field.indexOf("有") == 0)
				{ field = "<span class=\"songti\">●</span>"; }
				if (field.indexOf("选配") == 0)
				{ field = "<span class=\"songti\">○</span>"; }
				if (field.indexOf("无") == 0)
				{ field = "<span class=\"songti\">-</span>"; }
				// modified by chengl Dec.28.2009 for calculator
				if (arrFieldRow["sFieldTitle"] == "厂家指导价" && field != "无" && field != "待查") {
					arrTemp.push("<b>" + field + "</b>");
					arrTemp.push("<a class=\"icon_cal\" title=\"购车费用计算\" href=\"http://car.bitauto.com/gouchejisuanqi/?carid=" + ComparePageObject.AllCarJson[i][0][0] + "\"  target=\"_blank\"></a>");
				}
				else if (checkTitleIsThreeLines(arrFieldRow["sFieldTitle"])) {
					arrTemp.push("<span class=\"tdThreeLines\" title=\"" + field + "\">" + field + "</span>");
				}
				else if (checkTitleIsTwoLines(arrFieldRow["sFieldTitle"])) {
					arrTemp.push("<span class=\"tdTwoLines\" title=\"" + field + "\">" + field + "</span>");
				}
				else {
					//arrTemp.push(field);
					if (!chkResult.IsSame && ComparePageObject.IsVantage) {
						//只有一个值不标示优势项 -1代表一个值
						var tempFlag = false;
						if (!isNaN(chkResult.CurrParamsValue) && !isNaN(field)) {
							tempFlag = (parseFloat(chkResult.CurrParamsValue) == parseFloat(field));
 						} else {
							tempFlag = (chkResult.CurrParamsValue == field);
						}
						if (chkResult.CurrCarIndex != -1 && tempFlag && arrFieldRow["isVantage"] && arrFieldRow["isVantage"] == "1")
							arrTemp.push("<strong class=\"best\">" + field + "</strong>");
						else
							arrTemp.push(field);
					}
					else
						arrTemp.push(field);
				}
			}
			catch (err) {
				arrTemp.push("-");
				firstSame = firstSame && false;
			}
			arrTemp.push("</td>");
		}
		else {
			arrTemp.push("<td>&nbsp;");
			arrTemp.push("</td>");
		}
		isShowLoop++;
	}
	if (firstSame && ComparePageObject.IsDelSame) {
		return;
	}
	else {
		if (!isAllunknown) {
			// Is Need Show The Bar
			if (ComparePageObject.ArrTempBarHTML.length > 0) {
				ComparePageObject.ArrPageContent.push(ComparePageObject.ArrTempBarHTML.join(""));
				ComparePageObject.ArrTempBarHTML.length = 0;
				//添加左侧菜单
				ComparePageObject.ArrLeftNavHTML.push(ComparePageObject.ArrTempLeftNavHTML.join(''));
				ComparePageObject.ArrTempLeftNavHTML.length = 0;
			} else {
				//ComparePageObject.ArrHideLeftNavIds.push(ComparePageObject.ArrTempHideLeftNavId.join(''));
				//ComparePageObject.ArrTempHideLeftNavId.length = 0;
			}
			if (ComparePageObject.ArrTempBarForFloatLeftHTML.length > 0) {
				ComparePageObject.FloatLeft.push(ComparePageObject.ArrTempBarForFloatLeftHTML.join(""));
				ComparePageObject.ArrTempBarForFloatLeftHTML.length = 0;
			}

			ComparePageObject.ArrPageContent.push("<tr>");
			if (checkTitleIsThreeLines(arrFieldRow["sFieldTitle"])) {
				ComparePageObject.ArrPageContent.push("<th class=\"threeLines\">");
				ComparePageObject.FloatLeft.push("<tr><th class=\"threeLines\">" + checkBaikeForTitle(arrFieldRow) + "</th></tr>");
			}
			else {
				ComparePageObject.ArrPageContent.push("<th>");
				ComparePageObject.FloatLeft.push("<tr><th>" + checkBaikeForTitle(arrFieldRow) + "</th></tr>");
			}
			ComparePageObject.ArrPageContent.push(checkBaikeForTitle(arrFieldRow));
			ComparePageObject.ArrPageContent.push("</th>");
			ComparePageObject.ArrPageContent.push(arrTemp.join(""));
		}
		else {
			return;
		}
	}
	//when less
	if (ComparePageObject.NeedBlockTD > 0) {
		for (var i = 0; i < ComparePageObject.NeedBlockTD; i++) {
			if (i > 0)
			{ ComparePageObject.ArrPageContent.push("<td class=\"noBg\">"); }
			else
			{ ComparePageObject.ArrPageContent.push("<td>"); }
			ComparePageObject.ArrPageContent.push("&nbsp;");
			ComparePageObject.ArrPageContent.push("</td>");
		}
	}
	ComparePageObject.ArrPageContent.push("</tr>");
}

//判断参数值是否相同
function IsFieldSame(arrFieldRow) {
	var tempArray = new Array();
	var paramArray = arrFieldRow["sFieldIndex"].split(',');
	var unitArray = arrFieldRow["unit"].split(',');
	var joinCodeArray = arrFieldRow["joinCode"].split(',');
	var pidArray = arrFieldRow["sPid"].split(',');
	var prefixArray = arrFieldRow["sTrPrefix"].split(',');

	var result = { IsSame: true, CurrCarIndex: 0, CurrParamsValue: 0 }, tempField = null, allCarFieldArr = [];
	try {
		for (var i = 0; i < ComparePageObject.ValidCount; i++) {
			if (!ComparePageObject.AllCarJson[i]) continue;
			var multiField = "";
			for (var pint = 0; pint < paramArray.length; pint++) {
				// loop every param
				var sTrPrefix = arrFieldRow["sTrPrefix"];
				var index = paramArray[pint];
				if (ComparePageObject.AllCarJson[i].length <= prefixArray[pint])
				{ return; }
				if (ComparePageObject.AllCarJson[i][prefixArray[pint]].length <= index)
				{ return; }
				var field = ComparePageObject.AllCarJson[i][prefixArray[pint]][index] || "";
				multiField = multiField + field;
			}
			//判断是否是数字 解决 8.2、8.20 现象
			if (!isNaN(multiField) && !isNaN(tempField)) {
				if (parseFloat(multiField) != parseFloat(tempField) && tempField != null) result.IsSame = false;
			} else { if (multiField != tempField && tempField != null) result.IsSame = false; }

			if (arrFieldRow["isVantage"] && arrFieldRow["isVantage"] == "1") {
				//空值排除比较
				var tempMultiField = "";
				if (multiField != "") {
					//对取值范围值特殊处理
					if (multiField.indexOf('-') != -1) {
						if (arrFieldRow["size"] && arrFieldRow["size"] == "1")
							tempMultiField = multiField.substring(multiField.indexOf('-') + 1);
						else
							tempMultiField = multiField.substring(0, multiField.indexOf('-'));
					} else
						tempMultiField = multiField;
					//console.log(arrFieldRow["sFieldTitle"] + tempMultiField);
					if (allCarFieldArr.indexOf(tempMultiField) == -1)
						allCarFieldArr.push(tempMultiField);
				}
				if (arrFieldRow["size"] && arrFieldRow["size"] == "1") {
					if (tempMultiField >= allCarFieldArr.max() && tempMultiField != "") {
						result.CurrParamsValue = multiField;
						result.CurrCarIndex = i;
					}
				} else {
					if (tempMultiField <= allCarFieldArr.min() && tempMultiField != "") {
						//console.log(arrFieldRow["sFieldTitle"] + multiField + "come in");
						result.CurrParamsValue = multiField;
						result.CurrCarIndex = i;
					}
				}
			}
			//上次临时值
			tempField = multiField;
		}
		if (allCarFieldArr.length <= 1) { result.CurrCarIndex = -1; result.CurrParamsValue = 0; }
	} catch (e) { }
	return result;
}

// create multi param for compare
function createMulti(arrFieldRow) {
	var paramArray = arrFieldRow["sFieldIndex"].split(',');
	var unitArray = arrFieldRow["unit"].split(',');
	var joinCodeArray = arrFieldRow["joinCode"].split(',');
	var pidArray = arrFieldRow["sPid"].split(',');
	var prefixArray = arrFieldRow["sTrPrefix"].split(',');

	var firstSame = true;
	var isAllunknown = true;
	var arrSame = new Array();
	var arrTemp = new Array();
	var isShowLoop = 0;

	var chkResult = { IsSame: true, CurrCarIndex: 0, CurrParamsValue: 0 };
	if ((ComparePageObject.IsVantage && arrFieldRow["isVantage"] && arrFieldRow["isVantage"] == "1") || ComparePageObject.IsShowDiff)
		chkResult = IsFieldSame(arrFieldRow);

	// loop every car
	var tempArrMultField = [];
	for (var i = 0; i < ComparePageObject.ValidCount; i++) {
		if (ComparePageObject.AllCarJson[i]) {
			if (!chkResult.IsSame)
				arrTemp.push("<td name=\"td" + i + "\" class=\"bg-blue\">");
			else
				arrTemp.push("<td name=\"td" + i + "\" >");
			try {
				var multiField = "";
				for (var pint = 0; pint < paramArray.length; pint++) {
					// 组合类型
					if (pidArray[pint] == "577") {
						// 如果当前是 燃油标号 前1项不是汽油的话不显示
						if (multiField.indexOf("汽油") < 0)
						{ continue; }
					}
					if (pidArray[pint] == "408") {
						// 如果自然吸气直接显示，如果是增压则显示增压方式
						if (multiField.indexOf("增压") < 0)
						{ continue; }
						else { multiField = ""; }
					}
					// loop every param
					var sTrPrefix = arrFieldRow["sTrPrefix"];
					var index = paramArray[pint];
					if (ComparePageObject.AllCarJson[i].length <= prefixArray[pint])
					{ return; }
					if (ComparePageObject.AllCarJson[i][prefixArray[pint]].length <= index)
					{ return; }
					var field = ComparePageObject.AllCarJson[i][prefixArray[pint]][index] || "";
					//档位数 无极变速 不显示
					if (pidArray[pint] == "724") {
						if (isNaN(field) || parseInt(field) <= 0)
							continue;
					}
					// modified by chengl May.31.2012
					if (pidArray[pint] == "577") {
						// 燃油标号 90改为：89或90；93改为：92或93；97改为：95或97；
						switch (field) {
							case "90号": field = field + "(北京89号)"; break;
							case "93号": field = field + "(北京92号)"; break;
							case "97号": field = field + "(北京95号)"; break;
							default: break;
						}
					}
					if (field == "待查")
					{ field = ""; }
					if (field.length > 0) {
						if (pidArray[pint] == "659") {
							// 百公里等速油耗速度 合并
							if (field == "综合")
							{ field = "(" + field + ")"; }
							else
							{ field = "(" + field + unitArray[pint] + ")"; }
						}
						else {
							field += unitArray[pint] || "";
						}
						multiField = multiField + (joinCodeArray[pint] || "") + field;
					}

					if (arrSame.length < 1) {
						arrSame.push(multiField);
					}
					else {
						if (multiField == arrSame[0])
						{ firstSame = firstSame && true; }
						else
						{ firstSame = firstSame && false; }
					}
					if (multiField.indexOf("待查") >= 0 || multiField == "") {
						isAllunknown = true && isAllunknown;
					}
					else {
						isAllunknown = false;
					}
					if (multiField.indexOf("有") >= 0)
					{ multiField = "<span class=\"songti\">●</span>"; }
					if (multiField.indexOf("选配") >= 0 && multiField.indexOf("●") < 0)
					{ multiField = "<span class=\"songti\">○</span>"; }
					if (multiField.indexOf("无") >= 0 && multiField.indexOf("●") < 0 && multiField.length == 1)
					{ multiField = "<span class=\"songti\">-</span>"; }

					if (pint == 0) {
						// 如果第1项是有，则不显示有，显示第2项
						if (multiField == "<span class=\"songti\">●</span>")
						{ multiField = ""; }
						else if (multiField == "<span class=\"songti\">○</span>" || multiField == "<span class=\"songti\">-</span>")
						{ break; }
						else { }
						// 如果第1项是选配或无，则不显示第2项
					}
				}
				//=================每项多个属性对比 2012-04-11 by songkai===================
				firstSame = true;
				if (ComparePageObject.IsDelSame) {
					tempArrMultField.push(multiField);
					var flag = true;
					if (i == ComparePageObject.ValidCount - 1) {
						for (var k = 0; k < tempArrMultField.length; k++) {
							if (tempArrMultField[k] != multiField) {
								flag = false;
								firstSame = false;
								break;
							}
						}
						if (flag) {
							continue;
						} else {
							//arrTemp.splice(0, arrTemp.length);
							arrTemp = [];
							for (var m = 0; m < tempArrMultField.length; m++) {
								if (!chkResult.IsSame)
									arrTemp.push("<td name=\"td" + m + "\" class=\"bg-blue\">");
								else
									arrTemp.push("<td name=\"td" + m + "\" >");
								arrTemp.push(tempArrMultField[m]);
								arrTemp.push("</td>");
							}
						}
					}
				} else {
					arrTemp.push(multiField);
					//					if (!chkResult.IsSame && ComparePageObject.IsVantage) {
					//						arrTemp.push("<strong class=\"best\">" + multiField + "</strong>");
					//					}
					//					else
					//						arrTemp.push(multiField);
				}
			}
			catch (err) {
				arrTemp.push("-");
				firstSame = firstSame && false;
			}
			if (!ComparePageObject.IsDelSame) arrTemp.push("</td>");
			//===========================================================
		}
		else {
			arrTemp.push("<td>&nbsp;");
			arrTemp.push("</td>");
		}
		isShowLoop++;
	}
	//-----------
	if (firstSame && ComparePageObject.IsDelSame) {
		return;
	}
	else {
		if (!isAllunknown) {
			// Is Need Show The Bar
			if (ComparePageObject.ArrTempBarHTML.length > 0) {
				ComparePageObject.ArrPageContent.push(ComparePageObject.ArrTempBarHTML.join(""));
				ComparePageObject.ArrTempBarHTML.length = 0;
				//添加左侧菜单
				ComparePageObject.ArrLeftNavHTML.push(ComparePageObject.ArrTempLeftNavHTML.join(''));
				ComparePageObject.ArrTempLeftNavHTML.length = 0;
			}
			if (ComparePageObject.ArrTempBarForFloatLeftHTML.length > 0) {
				ComparePageObject.FloatLeft.push(ComparePageObject.ArrTempBarForFloatLeftHTML.join(""));
				ComparePageObject.ArrTempBarForFloatLeftHTML.length = 0;
			}
			ComparePageObject.FloatLeft.push("<tr><th>" + checkBaikeForTitle(arrFieldRow) + "</th></tr>");
			ComparePageObject.ArrPageContent.push("<tr>");
			ComparePageObject.ArrPageContent.push("<th>");
			ComparePageObject.ArrPageContent.push(checkBaikeForTitle(arrFieldRow));
			ComparePageObject.ArrPageContent.push("</th>");
			ComparePageObject.ArrPageContent.push(arrTemp.join(""));
			ComparePageObject.LoopTRColor++;
		}
		else {
			return;
		}
	}
	//when less
	if (ComparePageObject.NeedBlockTD < ComparePageObject.MaxTDLeft) {
		for (var i = 0; i < ComparePageObject.NeedBlockTD; i++) {
			if (i > 0)
			{ ComparePageObject.ArrPageContent.push("<td class=\"noBg\">"); }
			else
			{ ComparePageObject.ArrPageContent.push("<td>"); }
			ComparePageObject.ArrPageContent.push("&nbsp;");
			ComparePageObject.ArrPageContent.push("</td>");
		}
	}
	ComparePageObject.ArrPageContent.push("</tr>");
}

// create price for compare
function createPrice(arrFieldRow) {
	ComparePageObject.FloatLeft.push("<tr><th>" + checkBaikeForTitle(arrFieldRow) + "</th></tr>");
	ComparePageObject.ArrPageContent.push("<tr>");
	ComparePageObject.ArrPageContent.push("<th>" + checkBaikeForTitle(arrFieldRow) + "</th>");
	var isShowLoop = 0;
	for (var i = 0; i < ComparePageObject.ValidCount; i++) {
		if (ComparePageObject.AllCarJson[i]) {
			ComparePageObject.ArrPageContent.push("<td name=\"td" + i + "\" >");
			try {
				var sTrPrefix = arrFieldRow["sTrPrefix"];
				var index = arrFieldRow["sFieldIndex"];
				var field = ComparePageObject.AllCarJson[i][sTrPrefix][index] || "";
			}
			catch (err) {
				ComparePageObject.ArrPageContent.push("-");
			}
			if (field.length < 1 || field == "无") {
				ComparePageObject.ArrPageContent.push("无");
			}
			else {
				if (arrFieldRow["sFieldTitle"] == "商家报价") {
					ComparePageObject.ArrPageContent.push("<span class=\"cRed\"><a target=\"_blank\" href=\"http://price.bitauto.com/car.aspx?newcarid=" + ComparePageObject.AllCarJson[i][0][0] + "&citycode=0\">" + field.replace('～', '-') + "</a></span>");
					ComparePageObject.ArrPageContent.push("<p><a target=\"_blank\" href=\"http://dealer.bitauto.com/zuidijia/nb" + (ComparePageObject.AllCarJson[i][0][3] || "") + "/nc" + ComparePageObject.AllCarJson[i][0][0] + "/\">询最低价>></a></p>");
				}
				else if (arrFieldRow["sFieldTitle"] == "降价优惠") {
					var csAllSpell = ComparePageObject.AllCarJson[i][0][6] || "";
					ComparePageObject.ArrPageContent.push("<span class=\"tdJiangjia\"><a target=\"_blank\" href=\"http://car.bitauto.com/" + csAllSpell + "/m" + ComparePageObject.AllCarJson[i][0][0] + "/jiangjia/\">" + field + "</a></span>");
				}
				else
				{ }
			}
			ComparePageObject.ArrPageContent.push("</td>");
		}
		isShowLoop++;
	}
	//when less
	if (ComparePageObject.NeedBlockTD > 0) {
		for (var i = 0; i < ComparePageObject.NeedBlockTD; i++) {
			if (i > 0)
			{ ComparePageObject.ArrPageContent.push("<td class=\"noBg\">"); }
			else
			{ ComparePageObject.ArrPageContent.push("<td>"); }
			ComparePageObject.ArrPageContent.push("</td>");
		}
	}
	ComparePageObject.ArrPageContent.push("</tr>");
}

// more infomation
function createOther(arrFieldRow) {
	if (ComparePageObject.ArrTempBarHTML.length > 0) {
		ComparePageObject.ArrPageContent.push(ComparePageObject.ArrTempBarHTML.join(""));
		ComparePageObject.ArrTempBarHTML.length = 0;
	}
	if (ComparePageObject.ArrTempBarForFloatLeftHTML.length > 0) {
		ComparePageObject.FloatLeft.push(ComparePageObject.ArrTempBarForFloatLeftHTML.join(""));
		ComparePageObject.ArrTempBarForFloatLeftHTML.length = 0;
	}
	ComparePageObject.FloatLeft.push("<tr><th class=\"threeLines\">" + (arrFieldRow["sFieldTitle"] == "" ? "&nbsp;" : checkBaikeForTitle(arrFieldRow)) + "</th></tr>");
	// more link
	ComparePageObject.ArrPageContent.push("<tr >");
	ComparePageObject.ArrPageContent.push("<th class=\"threeLines\">" + (arrFieldRow["sFieldTitle"] == "" ? "&nbsp;" : checkBaikeForTitle(arrFieldRow)) + "</th>");
	var isShowLoop = 0;
	for (var i = 0; i < ComparePageObject.ValidCount; i++) {
		if (ComparePageObject.AllCarJson[i]) {
			ComparePageObject.ArrPageContent.push("<td name=\"td" + i + "\" >");
			try {
				var sTrPrefix = arrFieldRow["sTrPrefix"];
				var index = arrFieldRow["sFieldIndex"];
				var csBBS = ComparePageObject.AllCarJson[i][sTrPrefix][index] || "";
				var csAllSpell = ComparePageObject.AllCarJson[i][0][6] || "";
				var csShowName = ComparePageObject.AllCarJson[i][0][5] || "";
				var t1 = csShowName.replace(/([\u0391-\uffe5])/ig, '$1a');
				var t2 = t1.substring(0, 12);
				var tempShowName = t2.replace(/([\u0391-\uffe5])a/ig, '$1');
				if (tempShowName == csShowName)
				{ tempShowName += ""; }
				else
				{ tempShowName += "…"; }
				// csShowName = csShowName.substring(0, 10).replace(/([\u0391-\uffe5])/ig, '$1a').substring(0, c).replace(/([\u0391-\uffe5])a/ig, '$1');
				var csName = ComparePageObject.AllCarJson[i][0][4] || "";
				ComparePageObject.ArrPageContent.push("<p><a target=\"_blank\" href=\"/" + csAllSpell + "/koubei/\">" + tempShowName + "口碑</a></p>");
				ComparePageObject.ArrPageContent.push("<p><a target=\"_blank\" href=\"/" + csAllSpell + "/youhao/\">" + tempShowName + "油耗</a></p>");
				ComparePageObject.ArrPageContent.push("<p><a target=\"_blank\" href=\"" + csBBS + "\">" + tempShowName + "论坛</a></p>");
			}
			catch (err) {
				ComparePageObject.ArrPageContent.push("-");
			}
			ComparePageObject.ArrPageContent.push("</td>");
		}
		isShowLoop++;
	}
	//when less
	if (ComparePageObject.NeedBlockTD > 0) {
		for (var i = 0; i < ComparePageObject.NeedBlockTD; i++) {
			if (i > 0)
			{ ComparePageObject.ArrPageContent.push("<td class=\"noBg\">"); }
			else
			{ ComparePageObject.ArrPageContent.push("<td>"); }
			ComparePageObject.ArrPageContent.push("</td>");
		}
	}
	ComparePageObject.ArrPageContent.push("</tr>");
}

function createIndex(arrFieldRow) {
	if (ComparePageObject.ArrTempBarHTML.length > 0) {
		ComparePageObject.ArrPageContent.push(ComparePageObject.ArrTempBarHTML.join(""));
		ComparePageObject.ArrTempBarHTML.length = 0;
	}
	if (ComparePageObject.ArrTempBarForFloatLeftHTML.length > 0) {
		ComparePageObject.FloatLeft.push(ComparePageObject.ArrTempBarForFloatLeftHTML.join(""));
		ComparePageObject.ArrTempBarForFloatLeftHTML.length = 0;
	}
	ComparePageObject.FloatLeft.push("<tr class=\"car-focus-index\"><th>" + (arrFieldRow["sFieldTitle"] == "" ? "&nbsp;" : arrFieldRow["sFieldTitle"]) + "</th></tr>");
	// more link
	ComparePageObject.ArrPageContent.push("<tr class=\"car-focus-index\">");
	ComparePageObject.ArrPageContent.push("<th>" + (arrFieldRow["sFieldTitle"] == "" ? "&nbsp;" : arrFieldRow["sFieldTitle"]) + "</th>");
	var isShowLoop = 0;
	for (var i = 0; i < ComparePageObject.ValidCount; i++) {
		var csid = ComparePageObject.AllCarJson[i][0][3] != "undefined" ? ComparePageObject.AllCarJson[i][0][3] : "";
		var csLevel = ComparePageObject.AllCarJson[i][0][12] != "undefined" ? ComparePageObject.AllCarJson[i][0][12] : "";
		if (ComparePageObject.AllCarJson[i]) {
			ComparePageObject.ArrPageContent.push("<td name=\"td" + i + "\" >");
			try {
				ComparePageObject.ArrPageContent.push("<span class=\"tdTwoLines\">");
				if (carIndexJson != "undefined") {
					if (carIndexJson[csid] != "undefined") {
						var uvRank = 0;
						var saleRank = 0;
						if (carIndexJson[csid].UVRank != "undefined") {
							uvRank = carIndexJson[csid].UVRank;
						}
						if (carIndexJson[csid].SaleRank != "undefined") {
							saleRank = carIndexJson[csid].SaleRank;
							ComparePageObject.ArrPageContent.push("");
						}
						if (uvRank > 0) {
							ComparePageObject.ArrPageContent.push("<p><a target=\"_blank\" href=\"http://index.bitauto.com/guanzhu/s" + csid + "/\">" + csLevel + "关注</a>");
							ComparePageObject.ArrPageContent.push("<span>第<em>" + uvRank + "</em>名</span>");
							ComparePageObject.ArrPageContent.push("</p>");
						}
						else
						{ ComparePageObject.ArrPageContent.push("<p>暂无关注数据</p>"); }
						if (saleRank > 0) {
							ComparePageObject.ArrPageContent.push("<p><a target=\"_blank\" href=\"http://index.bitauto.com/xiaoliang/s" + csid + "/\">" + csLevel + "销量</a>");
							ComparePageObject.ArrPageContent.push("<span>第<em>" + saleRank + "</em>名</span>");
							ComparePageObject.ArrPageContent.push("</p>");
						}
						else
						{ ComparePageObject.ArrPageContent.push("<p>暂无销量数据</p>"); }
					}
				}
				ComparePageObject.ArrPageContent.push("</span>");
			}
			catch (err) {
				ComparePageObject.ArrPageContent.push("-");
			}
			ComparePageObject.ArrPageContent.push("</td>");
		}
		isShowLoop++;
	}
	//when less
	if (ComparePageObject.NeedBlockTD > 0) {
		for (var i = 0; i < ComparePageObject.NeedBlockTD; i++) {
			if (i > 0)
			{ ComparePageObject.ArrPageContent.push("<td class=\"noBg\">"); }
			else
			{ ComparePageObject.ArrPageContent.push("<td>"); }
			ComparePageObject.ArrPageContent.push("</td>");
		}
	}
	ComparePageObject.ArrPageContent.push("</tr>");
}

// when match title add link to baike
function checkBaikeForTitle(arrFieldRow) {
	var title, unit;
	title = arrFieldRow["sFieldTitle"];
	unit = arrFieldRow["unit"];
	if (ComparePageObject.BaikeObj == null
	&& typeof (CarChannelBaikeJson) != "undefined"
	&& CarChannelBaikeJson.length > 0) {
		ComparePageObject.BaikeObj = new Object;
		for (var i = 0; i < CarChannelBaikeJson.length; i++) {
			for (var key in CarChannelBaikeJson[i]) {
				ComparePageObject.BaikeObj[key] = CarChannelBaikeJson[i][key];
			}
		}
	}
	if (ComparePageObject.BaikeObj
	&& ComparePageObject.BaikeObj[title]) {
		return "<a href='" + ComparePageObject.BaikeObj[title] + "' target='_blank'>" + title + "<em>" + (unit != "" && unit.indexOf(",") == -1 ? "(" + unit + ")" : "") + "</em></a>";
	}
	else
	{ return title + "<em>" + (unit != "" && unit.indexOf(",") == -1 ? "(" + unit + ")" : "") + "</em>"; }
}

function checkTitleIsThreeLines(sFieldTitle) {
	var isThreeLines = false;
	if (sFieldTitle == "车身颜色" || sFieldTitle == "座椅颜色" || sFieldTitle == "内饰颜色") {
		isThreeLines = true;
	}
	return isThreeLines;
}

function checkTitleIsTwoLines(sFieldTitle) {
	var isTwoLines = false;
	if (sFieldTitle == "保修政策"
	|| sFieldTitle == "特有技术"
	|| sFieldTitle == "发动机型号"
	|| sFieldTitle == "主动安全-其他"
	|| sFieldTitle == "后悬挂类型"
	|| sFieldTitle == "前悬挂类型") {
		isTwoLines = true;
	}
	return isTwoLines;
}

// add car to compare
function addCarToCompareForSelect(id, name, csName) {
	var newCarID = new Array();
	if (ComparePageObject.AllCarJson.length > 0) {
		if (ComparePageObject.AllCarJson.length == 10) {
			alert("对比车型不能多于10个");
			return;
		}
		for (var i = 0; i < ComparePageObject.AllCarJson.length; i++) {
			if (id == ComparePageObject.AllCarJson[i][0][0]) {
				alert("您选择的车型,已经在对比列表中!");
				return;
			}
			newCarID.push(ComparePageObject.AllCarJson[i][0][0]);
		}
	}
	newCarID.push(id);
	//删除添加车款后再添加相同车款 页面不刷新
	if (window.location.search == "?carIDs=" + newCarID.join(",") + "") {
		//document.location.href = "/chexingduibi/?carIDs=" + newCarID.join(",") + "&t=" + Math.random() + "#CarHotCompareList";
		location.reload();
	}
	else {
		var paramsArr = [];
		if (ComparePageObject.IsOperateTheSame)
			paramsArr.push("diff");
		if (ComparePageObject.IsShowDiff)
			paramsArr.push("showdiff");
		if (ComparePageObject.IsVantage)
			paramsArr.push("vantage");

		document.location.href = "/chexingduibi/?carIDs=" + newCarID.join(",") + "#CarHotCompareList" + (paramsArr.length > 0 ? "&" + paramsArr.join("&") : "") + "";
	}
}

function checkIsCloseHotCompare() {
	if (CookieForTempSave.getCookie("UserCloseCarList") == "1")
	{ ComparePageObject.IsCloseHotList = true; }
}

function closeHotCompare() {
	// $("#trOtherCarListForFloatLeft").empty();
	$(".firstCar_pop").hide();
	//	$("#trForPic td,#trForPic th").each(function () {
	//		$(this).removeClass("bdbottomnone");
	//	});
	CookieForTempSave.setCookie("UserCloseCarList", "1");
	ComparePageObject.IsCloseHotList = true;
	$("#pkButton").show();
}

function showHotCompare(index) {
	$(".firstCar_pop").show();
	CookieForTempSave.clearCookie("UserCloseCarList");
	ComparePageObject.IsCloseHotList = false;
	// $("#pkButton_" + index).hide();
	ajaxOtherCarList(index);
}

// del car from compare
function delCarToCompare(index, e) {
	var newCarIDArr = new Array();
	if (ComparePageObject.ValidCount < 1) {
		alert('没有可删的了');
		return;
	}

	e = e || window.event;
	var target = e.srcElement || e.target;
	if (index >= 0 && ComparePageObject.ValidCount > index && ComparePageObject.AllCarJson.length > index) {
		//		//$("td[name='td" + index + "']").html("");
		//		//删除效果
		//		$(target).closest(".tableHead_item").animate({ width: 0 }, 500, function () {
		//			// del Array index object
		//			ComparePageObject.AllCarJson.splice(index, 1);
		//			if (ComparePageObject.AllCarJson.length == 1) {
		//				ComparePageObject.IsOperateTheSame = false;
		//			}
		//			initPageForCompare();
		//		});
		if (ComparePageObject.IsIE) {
			// del Array index object
			ComparePageObject.AllCarJson.splice(index, 1);
			if (ComparePageObject.AllCarJson.length == 1) {
				ComparePageObject.IsOperateTheSame = false;
			}
			initPageForCompare();
		}
		else {
			$("td[name='td" + index + "'][id!='td_" + index + "']").html("");
			//删除效果
			$(target).closest(".tableHead_item").fadeOut(300, function () {
				// del Array index object
				ComparePageObject.AllCarJson.splice(index, 1);
				if (ComparePageObject.AllCarJson.length == 1) {
					ComparePageObject.IsOperateTheSame = false;
				}
				initPageForCompare();
			});
		}

	}
}

function moveLeftForCarCompare(index) {
	if (index > 0 && ComparePageObject.ValidCount > index && ComparePageObject.AllCarJson.length > index) {
		swapArray(ComparePageObject.AllCarJson, index - 1, index);
	}
}

function moveRightForCarCompare(index) {
	if (index >= 0 && (ComparePageObject.ValidCount - 1) > index && (ComparePageObject.AllCarJson.length - 1) > index) {
		swapArray(ComparePageObject.AllCarJson, index, index * 1 + 1);
	}
}

// swap Array object and reshow compare content
function swapArray(obj, index1, index2) {
	var temp = obj[index1];
	obj[index1] = obj[index2];
	obj[index2] = temp;
	createPageForCompare(ComparePageObject.IsOperateTheSame);
}

function advantageForCompare() {
	if (ComparePageObject.ValidCount <= 1) return;
	//ComparePageObject.IsVantage = (!ComparePageObject.IsVantage) ? true : false;
	if (ComparePageObject.ValidCount > 1) {
		if (ComparePageObject.IsVantage) {
			ComparePageObject.IsVantage = false;
			$("input[type='checkbox'][name='chkAdvantage']").each(function (i, n) { this.checked = false; });
		} else {
			ComparePageObject.IsVantage = true;
			$("input[type='checkbox'][name='chkAdvantage']").each(function (i, n) { this.checked = true; });
		}
		createPageForCompare(ComparePageObject.IsDelSame);
	}
	gotoCheckPage();
	//$(window).scrollTop($(window).scrollTop() + 1);
}
//显示差异
function showDiffForCompare() {
	if (ComparePageObject.ValidCount <= 1) return;
	//ComparePageObject.IsShowDiff = (ComparePageObject.IsShowDiff) ? true : false;
	if (ComparePageObject.ValidCount > 1) {
		if (ComparePageObject.IsShowDiff) {
			ComparePageObject.IsShowDiff = false;
			$("input[type='checkbox'][name='checkboxForDiff']").each(function (i, n) { this.checked = false; });
		} else {
			ComparePageObject.IsShowDiff = true;
			$("input[type='checkbox'][name='checkboxForDiff']").each(function (i, n) { this.checked = true; });
		}
		createPageForCompare(ComparePageObject.IsDelSame);
	}
	gotoCheckPage();
	//$(window).scrollTop($(window).scrollTop() + 1);
}
//获取多选框参数
function gotoCheckPage() {
	var paramsArr = [];
	if (ComparePageObject.IsOperateTheSame)
		paramsArr.push("diff");
	if (ComparePageObject.IsShowDiff)
		paramsArr.push("showdiff");
	if (ComparePageObject.IsVantage)
		paramsArr.push("vantage");
	//刷新页面
	if (ComparePageObject.AllCarJson.length > 0) {
		var tempArr = [];
		for (var i = 0; i < ComparePageObject.AllCarJson.length; i++) {
			tempArr.push(ComparePageObject.AllCarJson[i][0][0])
		}
		document.location.href = "/chexingduibi/?carIDs=" + tempArr.join(",") + "" + "#CarHotCompareList" + (paramsArr.length > 0 ? "&" + paramsArr.join("&") : "") + "&t";
	}
}
// 排除相同项
function delTheSameForCompare() {
	if (ComparePageObject.ValidCount <= 1) return;
	//ComparePageObject.IsOperateTheSame = (!ComparePageObject.IsOperateTheSame) ? true : false;

	//js 控制
	if (ComparePageObject.ValidCount > 1) {
		if (!ComparePageObject.IsOperateTheSame) {
			createPageForCompare(true);
			ComparePageObject.IsOperateTheSame = true;
			changeCheckBoxStateByName("checkboxForDelTheSame", true);
		}
		else {
			createPageForCompare(false);
			ComparePageObject.IsOperateTheSame = false;
			changeCheckBoxStateByName("checkboxForDelTheSame", false);
		}
	}
	gotoCheckPage();
	//$(window).scrollTop($(window).scrollTop() + 1);
}

function changeCheckBoxStateByName(name, state) {
	var checkBoxs = document.getElementsByName(name);
	if (checkBoxs && checkBoxs.length > 0) {
		for (var i = 0; i < checkBoxs.length; i++) {
			checkBoxs[i].checked = state;
		}
	}
}
//数组扩展方法
Array.prototype.indexOf = function (value) { for (var i = 0, l = this.length; i < l; i++) if (this[i] == value) return i; return -1; }
Array.prototype.max = function () { return Math.max.apply({}, this) }
Array.prototype.min = function () { return Math.min.apply({}, this) }

//绑定下拉选择框
function bindSelectForCompare() {
	var mdvalue = "0", sdvalue = "0";
	//	if (CookieForTempSave.getCookie("TempSelectMasterID") != "") {
	//		mdvalue = CookieForTempSave.getCookie("TempSelectMasterID");
	//		if (CookieForTempSave.getCookie("TempSelectSerialID") != "")
	//		{ sdvalue = CookieForTempSave.getCookie("TempSelectSerialID"); }
	//	}
	//modified by sk 2014.01.02 默认选择框根据选择车款最后一个
	if (ComparePageObject.ValidCount > 0) {
		var lastCarJson = ComparePageObject.AllCarJson[ComparePageObject.AllCarJson.length - 1],
		carId = lastCarJson[0][0];
		mdvalue = getMasterId(carId);
		sdvalue = lastCarJson[0][3];
	}
	//modified by sk 2013.03.27 广告
	var serialId = 0;
	if (typeof ComparePageObject.AllCarJson[0] != "undefined"
		&& typeof ComparePageObject.AllCarJson[0][0] != "undefined"
		&& ComparePageObject.AllCarJson[0][0][3] != "undefined") {
		serialId = ComparePageObject.AllCarJson[0][0][3];
	}
	if (ComparePageObject.ValidCount == 1
		&& typeof bit_locationInfo != "undefined"
		&& typeof carCompareAdJson != "undefined") {
		var cityId = bit_locationInfo.cityId;
		if (carCompareAdJson["0"] != undefined) {
			cityId = "0";
		}
		if (carCompareAdJson[cityId] != undefined) {
			for (var i = 0; i < carCompareAdJson[cityId].length; i++) {
				if (carCompareAdJson[cityId][i].serialids.indexOf(serialId) != -1) {
					mdvalue = carCompareAdJson[cityId][i].carad.masterid;
					sdvalue = carCompareAdJson[cityId][i].carad.serialid;
					break;
				}
			}
		}
	}
	ComparePageObject.BSelect = BitA.DropDownListNew({
		container: { master: "master4", serial: "serial4", cartype: "cartype4" },
		include: { serial: "1", cartype: "1" },
		dvalue: { master: mdvalue, serial: sdvalue },
		callback: { cartype: function (data) { setCarDisabled(); } },
		onchange: { cartype: function () { onchangeCarForSelect(); } }
	});
}

function onchangeCarForSelect(selectObj) {
	var selectBsID = ComparePageObject.BSelect.getValue("master");
	var selectCsID = ComparePageObject.BSelect.getValue("serial");
	//CookieForTempSave.setCookie("TempSelectMasterID", selectBsID);
	//CookieForTempSave.setCookie("TempSelectSerialID", selectCsID);
	addCarToCompareForSelect(ComparePageObject.BSelect.getValue("cartype"));
	fixWidthNormal(selectObj);
}
//根据车型获取主品牌ID
function getMasterId(carId) {
	var masterId = 0;
	if (allCarInfo != undefined) {
		for (var i = 0; i < allCarInfo.length; i++) {
			if (allCarInfo[i].Key == carId) {
				masterId = allCarInfo[i].Value.MasterId;
				break;
			}
		}
	}
	return masterId;
}
//换车
function setSelectControlForCompare(objID, suffix) {
	if (objID.indexOf('_') >= 0) {
		var index = objID.substring(objID.lastIndexOf('_') + 1, objID.length);
		var serialId = ComparePageObject.AllCarJson[index][0][3];
		var carId = ComparePageObject.AllCarJson[index][0][0];
		var masterId = getMasterId(carId);

		var changeClassName = $("#" + objID + " .change-car-area a[id^='change_car_']").eq(0).attr("class");
		if (changeClassName == "btn-show-car") {
			$("#" + objID + " .change-car-area .popup-change-car").remove();
			$("#" + objID + " .change-car-area a[id^='change_car_']").eq(0).attr("class", "btn-hide-car");
			$("#" + objID).parent().siblings().find(".popup-change-car").hide().parent().children("a[id^='change_car_']").attr("class", "btn-show-car");
			$("#" + objID).parent().siblings().find(".popup-recom").hide().parent().children("a:first").attr("class", "btn-show-car");
			//设置为我推荐设置zindex
			var recomObj = $("#" + objID).parent().nextAll().find(".recom-car").eq(0).parent().parent();
			if (recomObj.length > 0) {
				var recomzIndex = parseInt(recomObj.css("z-index"));
				if (recomzIndex == 11) {
					var prevzIndex = parseInt(recomObj.prev().css("z-index"));
					recomObj.css({ 'z-index': prevzIndex - 1 });
				}
			}
		}
		else {
			$("#" + objID + " .change-car-area a[id^='change_car_']").eq(0).attr("class", "btn-show-car");
			$("#" + objID + " .change-car-area .popup-change-car").hide();
			return;
		}
		//当前展开层元素的居右宽度
		//var rightWidth = $(document).width() - ($("#" + objID).offset().left + $("#" + objID).outerWidth(true));

		//		var changeCarObj = $("#" + objID + " .change-car-area .popup-change-car");
		//		if (changeCarObj.length > 0) {
		//			changeCarObj.toggle();
		//			return;
		//		}
		var tempHmtl = [];
		//tempHmtl.push("<div class=\"popup-change-car " + (rightWidth < 435 ? "right" : "") + "\">");
		tempHmtl.push("<div class=\"popup-change-car\">");
		tempHmtl.push("<div class=\"popup-change-car-box\">");
		tempHmtl.push("<div id=\"MasterSelectList" + "_" + suffix + "_" + index + "\" class=\"sel-item-box\" style=\"z-index: 50\"></div>");
		tempHmtl.push("<div id=\"SerialSelectList" + "_" + suffix + "_" + index + "\" class=\"sel-item-box\" style=\"z-index: 40\"></div>");
		tempHmtl.push("<div id=\"CarTypeSelectList" + "_" + suffix + "_" + index + "\" class=\"sel-item-box\" style=\"z-index: 30\"></div>");
		tempHmtl.push("</div>");
		tempHmtl.push("<div class=\"recom-car-list\"><ul id=\"recom-car-list-" + objID + "\"></ul></div>");
		//tempHmtl.push("<a href=\"javascript:closeChangeCarList(" + index + ");\" class=\"btn-close-car\" alt=\"\">关闭</a>");
		tempHmtl.push("</div>");

		$("#" + objID + " .change-car-area").append(tempHmtl.join(''));
		//$("#" + objID + " .change-car-area #change_car_" + index).attr("class", "btn-hide-car").html("收起");

		var currentSelect = ComparePageObject.SelectControlTemp;
		while (currentSelect.indexOf("_ParamSuffix") != -1) {
			currentSelect = currentSelect.replace("_ParamSuffix", "_" + suffix + "_" + index);
		}
		while (currentSelect.indexOf("_BsSuffix") != -1) {
			currentSelect = currentSelect.replace("_BsSuffix", "_" + suffix + "_" + index);
			currentSelect = currentSelect.replace("[masterId]", masterId);
		}
		while (currentSelect.indexOf("_CsSuffix") != -1) {
			currentSelect = currentSelect.replace("_CsSuffix", "_" + suffix + "_" + index);
			currentSelect = currentSelect.replace("[serialId]", serialId);
		}
		while (currentSelect.indexOf("_CarSuffix") != -1) {
			currentSelect = currentSelect.replace("_CarSuffix", "_" + suffix + "_" + index);
			currentSelect = currentSelect.replace("[carId]", carId);
		}
		while (currentSelect.indexOf("[index]") != -1) {
			currentSelect = currentSelect.replace("[index]", "[" + index + "]");
		}
		//alert(currentSelect);
		//setTimeout(function () { eval(currentSelect); }, 200);
		eval(currentSelect);
		//为我推荐
		ajaxOtherCarList("recom-car-list-" + objID + "", index, 4, false);
		if (ComparePageObject.IsShowFloatTop)
		{ changeWhenFloatTop(); }
	}
}
//换车根据对比车款 params:车款ID，车款索引位置
function changeCarByIndex(carId, index) {
	var carIds = [];
	if (ComparePageObject.AllCarJson.length > 0) {
		for (var i = 0; i < ComparePageObject.AllCarJson.length; i++) {
			if (ComparePageObject.AllCarJson[i][0][0] == carId) {
				alert("您选择的车型,已经在对比列表中!");
				return;
			}
			else
			{ carIds.push(ComparePageObject.AllCarJson[i][0][0]); }
		}
	}
	if (carIds.length > index) {
		for (var i = 0; i < carIds.length; i++) {
			if (i == index) {
				carIds[i] = carId;
				break;
			}
		}
	}
	var paramsArr = [];
	if (ComparePageObject.IsOperateTheSame)
		paramsArr.push("diff");
	if (ComparePageObject.IsShowDiff)
		paramsArr.push("showdiff");
	if (ComparePageObject.IsVantage)
		paramsArr.push("vantage");

	document.location.href = "/chexingduibi/?carIDs=" + carIds.join(",") + "#CarHotCompareList" + (paramsArr.length > 0 ? "&" + paramsArr.join("&") : "") + "";
}
//换车根据下拉选择框 params:车款索引位置
function onchangeCarForSelectByIndex(index) {
	var selectBsID = ComparePageObject.CreateSelectChange[index].getValue("master");
	var selectCsID = ComparePageObject.CreateSelectChange[index].getValue("serial");
	//CookieForTempSave.setCookie("TempSelectMasterID", selectBsID);
	//CookieForTempSave.setCookie("TempSelectSerialID", selectCsID);
	var newid = ComparePageObject.CreateSelectChange[index].getValue("cartype");
	var newCarID = new Array();
	if (ComparePageObject.AllCarJson.length > 0) {
		for (var i = 0; i < ComparePageObject.AllCarJson.length; i++) {
			if (ComparePageObject.AllCarJson[i][0][0] == newCarID) {
				alert("您选择的车型,已经在对比列表中!");
				return;
			}
			else
			{ newCarID.push(ComparePageObject.AllCarJson[i][0][0]); }
		}
	}

	if (newCarID.length > index) {

		for (var i = 0; i < newCarID.length; i++) {
			if (i == index) {
				// current index change
				newCarID[i] = newid;
				break;
			}
		}
	}
	var paramsArr = [];
	if (ComparePageObject.IsOperateTheSame)
		paramsArr.push("diff");
	if (ComparePageObject.IsShowDiff)
		paramsArr.push("showdiff");
	if (ComparePageObject.IsVantage)
		paramsArr.push("vantage");

	document.location.href = "/chexingduibi/?carIDs=" + newCarID.join(",") + "#CarHotCompareList" + (paramsArr.length > 0 ? "&" + paramsArr.join("&") : "") + "";
}
//上一个车型对应的 为我推荐
function recomCarList(objId, prevIndex) {
	var carId = ComparePageObject.AllCarJson[prevIndex][0][0],
	fixWidth = 238;

	//当前展开层元素的居右宽度
	var rightWidth = $(document).width() - ($("#" + objId).offset().left + $("#" + objId).outerWidth(true));
	//获取上个元素zindex值
	var prevzIndex = parseInt($("#" + objId).parent().prev().css("z-index"));

	var changeClassName = $("#" + objId + " .recom-car a:first").attr("class");
	if (changeClassName == "btn-show-car") {
		$("#" + objId + " .recom-car a:first").attr("class", "btn-hide-car");
		//向左显示 父级zindex设置最大
		if (rightWidth < fixWidth) $("#" + objId).parent().css({ 'z-index': 11 });
	}
	else if (changeClassName == "btn-hide-car") {
		$("#" + objId + " .recom-car a:first").attr("class", "btn-show-car");
		if (rightWidth < fixWidth) $("#" + objId).parent().css({ 'z-index': prevzIndex - 1 });
	}

	$("#" + objId).parent().siblings().find(".popup-change-car").hide().parent().children("a[id^='change_car_']").attr("class", "btn-show-car");
	var changeCarObj = $("#" + objId + " .recom-car .popup-recom");
	if (changeCarObj.length > 0) {
		changeCarObj.toggle();
		return;
	}


	var tempHmtl = [];
	tempHmtl.push("<div class=\"popup-recom " + (rightWidth < fixWidth ? "right" : "") + "\" style=\"\">");
	tempHmtl.push("<div class=\"popup-recom-item\">");
	tempHmtl.push("<h5>大家都用它和谁比</h5>");
	tempHmtl.push("<ul id=\"recom-car-list-nocar-" + objId + "\"></ul>");
	tempHmtl.push("<a href=\"javascript:addAllCarToCompare('" + objId + "'," + prevIndex + ");\" class=\"btn-gray-big\">全部加入对比</a>");
	tempHmtl.push("</div>");
	//tempHmtl.push("<a href=\"javascript:closeRecomCarList(" + prevIndex + ");\" class=\"btn-close-car\">关闭</a>");
	tempHmtl.push("</div>");
	$("#" + objId + " .recom-car").append(tempHmtl.join(''));
	if (carId > 0) {
		ajaxOtherCarList("recom-car-list-nocar-" + objId + "", prevIndex, 5, true);
	}
}
//换车关闭
function closeChangeCarList(index) {
	$("#tableHead_" + index + ",#FloatTop_tableHead_" + index + "").find(".popup-change-car").hide().parent().find("a[id='change_car_" + index + "'],a[id='change_car_float_" + index + "']").attr("class", "btn-show-car");
}
//推荐关闭
function closeRecomCarList(prevIndex) {
	$("#tableHead_" + (prevIndex + 1) + ",#FloatTop_tableHead_" + (prevIndex + 1) + "").find(".recom-car .popup-recom").hide().parent().find("a:first").attr("class", "btn-show-car").text("为我推荐");
}
//添加所有推荐车型
function addAllCarToCompare(objId, index) {
	var tempArr = [], tempRecomArr = [];
	for (var i = 0; i < ComparePageObject.AllCarJson.length; i++) {
		tempArr.push(ComparePageObject.AllCarJson[i][0][0])
	}
	$("#recom-car-list-nocar-" + objId).find('li').each(function (i, n) {
		tempRecomArr.push(this.id.replace("recomCarList_", ""));
	});
	if (tempRecomArr.length <= 0) return;
	tempArr = tempArr.concat(tempRecomArr);
	if (tempArr.length > 10)
	{ alert("对比车型不能多于10个"); }
	else if (tempArr.length > 0) {
		//closeHotCompare();
		// 推荐类不统计
		if (window.location.search == "?carIDs=" + tempArr.join(",") + "&isrec=1") {
			location.reload();
		} else
			document.location.href = "/chexingduibi/?carIDs=" + tempArr.join(",") + "&isrec=1#CarHotCompareList";
	}
}
//请求推荐车型
function ajaxOtherCarList(id, index, top, isAdd) {
	if (ComparePageObject.AllCarJson.length > 0 && ComparePageObject.AllCarJson.length > index) {
		if (ComparePageObject.LastFirstInterface[ComparePageObject.AllCarJson[index][0][0]]) {
			//存储请求数据
			var content = getCompareCarListHtml(index, ComparePageObject.LastFirstInterface[ComparePageObject.AllCarJson[index][0][0]], top, isAdd);
			$("#" + id).html(content);
			//$("#recom-car-list-" + index).html(content);
			return;
		}
		$.ajax({
			url: ComparePageObject.OtherCarInterface + ComparePageObject.AllCarJson[index][0][0],
			cache: true,
			dataType: 'jsonp',
			jsonpCallback: "callback",
			success: function (data) {
				ComparePageObject.LastFirstInterface[ComparePageObject.AllCarJson[index][0][0]] = data;
				var content = getCompareCarListHtml(index, data, top, isAdd);
				$("#" + id).html(content);
				//$("#recom-car-list-" + index).html(content);
			}
		});
	}
}
//车款是否存在已选车款
function IsExistCarId(carId) {
	var result = false;
	if (ComparePageObject.AllCarJson.length > 0) {
		for (var i = 0; i < ComparePageObject.AllCarJson.length; i++) {
			if (carId == ComparePageObject.AllCarJson[i][0][0]) {
				result = true; break;
			}
		}
	}
	return result;
}
//大家跟谁比较
function getCompareCarListHtml(index, data, top, isAdd) {
	var carListHtml = [], loop = 0;
	if (top && top <= 0) top = 4;
	for (var i = 0; i < data.length; i++) {
		var carId = data[i].carId;
		var exist = IsExistCarId(carId);
		if (exist) { continue; }
		loop++;
		if (loop > top) break;
		if (isAdd)
			carListHtml.push("<li id=\"recomCarList_" + data[i].carId + "\"><a href=\"javascript:addCarToCompareFromlist(" + data[i].carId + ",'" + data[i].carName + "','" + data[i].serialName + "');\"><strong>" + data[i].serialName + "</strong><span>" + data[i].carYearType + "款 " + data[i].carName + "</span> +对比</a></li>");
		else
			carListHtml.push("<li id=\"recomCarList_" + data[i].carId + "\"><a href=\"javascript:changeCarByIndex('" + data[i].carId + "'," + index + ");\"><strong>" + data[i].serialName + "</strong><span>" + data[i].carYearType + "款 " + data[i].carName + "</span> 换车</a></li>");
	}
	return carListHtml.join('');
}

// set img drag
function setImgDrag() {
	$("img[name='imgdrag']").each(function (i) {
		$(this).parent().draggable({
			proxy: 'clone',
			revert: true,
			cursor: 'move',
			handle: "img",
			onStartDrag: function () {
				$(this).draggable('proxy').css({ 'z-index': '999' });
				$(this).closest("td").css({ 'z-index': '999' });
				// $(this).draggable('options').cursor = 'move';
				ComparePageObject.DragID = "";
				if (typeof (this.id) != "undefined" && this.id) {
					ComparePageObject.DragID = this.id.replace("draggcarbox_", "");
				}
			},
			onStopDrag: function () {
				$(this).css({ 'left': '0px', 'top': '0px' });
				//$(this).draggable('proxy').css({ 'z-index': '1' });
				$(this).closest("td").css({ 'z-index': '1' });

				// $(this).draggable('options').cursor = 'move';
				$(".carBox").each(function () {
					$(this).removeClass('moving');
				});
				if (ComparePageObject.DragID != "" && ComparePageObject.DropID != "" && ComparePageObject.DragID != ComparePageObject.DropID) {
					swapArray(ComparePageObject.AllCarJson, ComparePageObject.DragID, ComparePageObject.DropID);
				}
				ComparePageObject.DragID = "";
				ComparePageObject.DropID = "";
			}
		});
	});

	$(".sel-car-box").droppable({
		onDragEnter: function (e, source) {
			$(this).addClass('moving');
		},
		onDragLeave: function (e, source) {
			$(this).removeClass('moving');
		},
		onDrop: function (e, source) {
			$(source).draggable('proxy').remove();
			$(this).removeClass('moving');
			ComparePageObject.DropID = "";
			if (typeof (this.id) != "undefined" && this.id) {
				ComparePageObject.DropID = this.id.replace("carBox_", "");
			}
		}
	});
}

// Fix select Width for IE6
function FixWidth(selectObj) {
	//	if ($.browser.msie && $.browser.version == "6.0") {
	//		// ie6
	//		if (selectObj.id == "cartype4") {
	//			if (selectObj.className != "undefined") {
	//				if (selectObj.className.indexOf("car_select_w") >= 0) {
	//					$(selectObj).removeClass("car_select_w");
	//					$(selectObj).addClass("car_select_auto");
	//				}
	//				else {
	//					$(selectObj).removeClass("car_select_auto");
	//					$(selectObj).addClass("car_select_w");
	//				}
	//			}
	//			else
	//			{ alert("undefined"); }
	//		}
	//	}
	//	else {
	//		// not ie6
	//	}
}

function fixWidthAuto(selectObj) {
	if (ComparePageObject.IE6) {
		$(selectObj).removeClass("car_select_w");
		$(selectObj).addClass("car_select_auto");
	}
}

function fixWidthNormal(selectObj) {
	if (ComparePageObject.IE6) {
		$(selectObj).removeClass("car_select_auto");
		$(selectObj).addClass("car_select_w");
	}
}

function intiSelectControl() {
	var tempLate = [];
	//2013-12-23 替换下拉列表调用方式 by sk
	tempLate.push('ComparePageObject.CreateSelectChange[index] = BitA.DropDownListNew({');
	tempLate.push('	container: { master: "MasterSelectList_BsSuffix", serial: "SerialSelectList_CsSuffix", cartype: "CarTypeSelectList_CarSuffix" },');
	tempLate.push('	include: { serial: "1", cartype: "1" },');
	tempLate.push('	dvalue: { master: [masterId], serial: [serialId], cartype: [carId] },');
	tempLate.push('	callback: { cartype: function (data) { setCarDisabled(); } },');
	tempLate.push('	onchange: { cartype: function(){onchangeCarForSelectByIndex([index]);} }');
	tempLate.push('});');
	ComparePageObject.SelectControlTemp = tempLate.join("");
}
//--------------------  Cookie  --------------------
var CookieForTempSave = {
	setCookie: function (name, value) {
		document.cookie = name + "=" + escape(value) + "; domain=car.bitauto.com";
	},

	getCookie: function (name) {
		var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));

		if (arr != null) {
			return unescape(arr[2]);
		}
		return null;
	},

	clearCookie: function (name) {
		if (CookieForTempSave.getCookie(name)) {
			document.cookie = name + "=;domain=car.bitauto.com";
		}
	}
};

function setTRColorWhenMouse() {
	$('#CarCompareContent tr:gt(0)').hover(
		function () { $(this).addClass("bg-gray"); },
		function () { $(this).removeClass("bg-gray"); }
	);
}

function mathLeftMenuForResize(currScrollLeft, boxOffsetLeft, currScrollTop, boxOffsetTop) {
	if (ComparePageObject.ValidCount <= 0) return;
	if (boxOffsetLeft < 128 && boxOffsetLeft > 0) {
		$(".btn-show-left-nav").hide();
		$("#left-nav").hide();
	} else if (boxOffsetLeft == 0) {
		//$(".btn-show-left-nav").show();
		$("#left-nav").hide();
		//		if (currScrollTop > boxOffsetTop) {
		//			if (ComparePageObject.IE6) {
		//				$("#left-nav").css({ position: "absolute", top: currScrollTop - 80, left: currScrollLeft - boxOffsetLeft });
		//				$(".btn-show-left-nav").css({ position: "absolute", top: currScrollTop - 75, left: currScrollLeft - boxOffsetLeft });
		//			}
		//			else {
		//				$("#left-nav").css({ position: "fixed", top: "112px", left: "0px" });
		//				$(".btn-show-left-nav").css({ position: "fixed", top: "118px", left: "0px" });
		//			}
		//		} else {
		//			$("#left-nav").css({ position: "absolute", top: "200px", left: currScrollLeft - boxOffsetLeft });
		//			$(".btn-show-left-nav").css({ position: "fixed", top: "118px", left: "0px" });
		//		}

	} else {
		$(".btn-show-left-nav").hide();
		if (currScrollTop > boxOffsetTop) {
			$("#left-nav").css({ left: (boxOffsetLeft - 113 - currScrollLeft) });
		}
		$("#left-nav").show();
	}
}
//左侧菜单操作
//参数：（当前左侧滚动距离，居左距离，当前距顶距离，距顶距离）
function mathLeftMenu(currScrollLeft, boxOffsetLeft, currScrollTop, boxOffsetTop) {
	//对比车型大于1时，操作左侧滚动菜单
	if (ComparePageObject.ValidCount <= 0) return;

	if (currScrollLeft > boxOffsetLeft) {
		$(".btn-show-left-nav").show();
		//$("#left-nav").hide();
		if (currScrollTop > boxOffsetTop) {
			if (ComparePageObject.IE6) {
				$("#left-nav").css({ position: "absolute", top: currScrollTop - 80, left: currScrollLeft - boxOffsetLeft });
				$(".btn-show-left-nav").css({ position: "absolute", top: currScrollTop - 75, left: currScrollLeft - boxOffsetLeft });
			}
			else {
				$("#left-nav").css({ position: "fixed", top: "112px", left: "0px" });
				$(".btn-show-left-nav").css({ position: "fixed", top: "118px", left: "0px" });
			}
		} else {
			$("#left-nav").css({ position: "absolute", top: "200px", left: currScrollLeft - boxOffsetLeft });
			$(".btn-show-left-nav").css({ position: "absolute", top: "208px", left: (currScrollLeft - boxOffsetLeft) });
		}
	}
	//	else if (currScrollLeft == 0 && boxOffsetLeft == 0) {
	//		$(".btn-show-left-nav").show();
	//		$("#left-nav").addClass("left-nav-horizontal");
	//	}
	else {
		if (currScrollLeft == 0 && boxOffsetLeft > 128)	//左侧滚动0，菜单显示
			$("#left-nav").show();
		//		else if (currScrollLeft > 0)
		//			$("#left-nav").hide();

		if (currScrollTop > boxOffsetTop) {
			if (ComparePageObject.IE6)
				$("#left-nav").css({ position: "absolute", top: currScrollTop - 80, left: "-114px" });
			else {
				//$("#left-nav").css({ position: "fixed", top: "112px", left: "82px" });
				$("#left-nav").css({ position: "fixed", top: "112px", left: (boxOffsetLeft - 113 - currScrollLeft) });
			}
		} else {
			$("#left-nav").css({ position: "absolute", top: "200px", left: "-114px" });
		}
		$(".btn-show-left-nav").hide();
		$("#left-nav").removeClass("left-nav-horizontal");
	}
}
//滚动监听 滚动完成后回调函数
function scrollCallback() {
	var scrollsLeft = $(window).scrollLeft(); //窗口左卷动值
	var boxoffsetLeft = $("#box").offset().left; //计算box的offleft值
	if (scrollsLeft > boxoffsetLeft) {
		$("#left-nav").fadeOut(1000);
	}
}

$(function () {
	//回顶按钮
	$(".left-nav .duibi-return-top").click(function () {
		$("html").animate({ scrollTop: 0 }, 300); //IE,FF
		$("body").animate({ scrollTop: 0 }, 300); //Webkit
	});

	var theid = $("#topfixed");
	var the_lid = $("#leftfixed");
	var thebox = $("#box");
	var thesmall = $("#smallfixed")
	var floatkey;
	//////20110811修改隐藏显示浮动层
	var idmainoffsettop = $("#main_box").offset().top; //id的 offsettop
	var idmainoffsettop_top = idmainoffsettop + 90 //上浮动层出现top定位
	var idleftoffsetheight = $("#tableHead_left").height(); //左侧浮动层出现的top定位
	var idleftwidth = the_lid.width(); //左侧浮动层的宽度
	////////////////屏幕改变大小开始
	$(window).resize(function () {
		var boxoffset = thebox.offset();
		var boxoffsetLeft = boxoffset.left; //计算box的offleft值
		var scrollsLeft = $(window).scrollLeft(); //计算窗口左卷动值
		var scrolls = $(this).scrollTop();
		mathLeftMenuForResize(scrollsLeft, boxoffsetLeft, scrolls, idmainoffsettop_top);
		////////////left 浮动模开始式///////////////////////////
		if (scrollsLeft > boxoffsetLeft) {//当窗口大小改变时，如果窗口左滚动大于左侧块左位移
			if (window.XMLHttpRequest) {	//非IE6	
				the_lid.css({
					position: "fixed",
					top: (idmainoffsettop - scrolls), //+1
					left: 0,
					display: "block"
				});
			} else {//IE6
				the_lid.css({
					position: "absolute",
					top: 0,
					left: scrollsLeft - boxoffsetLeft,
					display: "block"
				});
			}
		} else {
			the_lid.css({
				display: "none"
			});
		}
		////////////left浮动模式结束//////////////////
		////////////左上角开始
		if (scrolls > idmainoffsettop_top && scrollsLeft > boxoffsetLeft) {
			if (window.XMLHttpRequest) {
				thesmall.css({
					position: "fixed",
					left: 0,
					top: 0,
					display: "block"
				});
			} else {//IE
				thesmall.css({
					position: "absolute",
					top: scrolls,
					left: scrollsLeft,
					display: "block"
				});
			}
		} else {
			thesmall.css({
				display: "none"
			});
		}
		////////////左上角结束
		if (floatkey) {//如果是在浮动状态
			//如果box的offsetleft =0 说明窗口小， 那么定位left=0 或者 负的leftscroll
			//如果box的offsetleft >0 说明窗口大，那么定位left=offsetleft 或者 leftscroll-offsetleft
			if (boxoffsetLeft == 0) {//窗口小
				if (scrollsLeft > 0) {
					if (window.XMLHttpRequest) {
						theid.css({
							left: -scrollsLeft
						});
					}
					else {//IE
						theid.css({
							left: 0
						});
					}
				} else {
					theid.css({
						left: 0
					});
				}
			}
			if (boxoffsetLeft > 0) {//窗口大
				if (scrollsLeft < boxoffsetLeft) {
					if (window.XMLHttpRequest) {
						theid.css({
							left: boxoffsetLeft - scrollsLeft
						});
					} else {
						theid.css({
							left: boxoffsetLeft
						});
					}
				} else {
					if (window.XMLHttpRequest) {
						theid.css({
							left: -(scrollsLeft - boxoffsetLeft)
						});
					} else {
						theid.css({
							left: boxoffsetLeft
						});
					}
				}
			}
		}
	});
	////////////////屏幕改变大小结束
	///////////////////屏幕卷动
	$(window).scroll(function () {
		var scrolls = $(this).scrollTop(); //窗口上卷动
		var scrollsLeft = $(this).scrollLeft(); //窗口左卷动值
		var boxoffset = thebox.offset();
		var boxoffsetLeft = boxoffset.left; //计算box的offleft值
		////////////左上角开始
		if (scrolls > idmainoffsettop_top && scrollsLeft > boxoffsetLeft) {
			if (window.XMLHttpRequest) {
				thesmall.css({ position: "fixed", left: 0, top: 0, display: "block" });
			} else {//IE
				thesmall.css({ position: "absolute", top: scrolls, left: scrollsLeft, display: "block" });
			}
		} else {
			thesmall.css({ display: "none" });
		}
		////////////左上角结束
		////////////left 浮动模开始式///////////////////////////
		if (scrollsLeft > boxoffsetLeft) {//当窗口大小改变时，如果窗口左滚动大于左侧块左位移
			if (window.XMLHttpRequest) {	//非IE6	
				the_lid.css({
					position: "fixed",
					top: (idmainoffsettop - scrolls), //+1
					left: 0,
					display: "block"
				});
			} else {//IE6
				the_lid.css({
					position: "absolute",
					top: 0,
					left: scrollsLeft - boxoffsetLeft,
					display: "block"
				});
			}
		} else {
			the_lid.css({ display: "none" });
		}
		//左侧菜单操作
		//window.setTimeout(function () { mathLeftMenu(scrollsLeft, boxoffsetLeft, scrolls, idmainoffsettop_top); }, 200);
		mathLeftMenu(scrollsLeft, boxoffsetLeft, scrolls, idmainoffsettop_top);
		////////////left浮动模式结束///////////////////
		////////////////控制上下卷动屏幕，出现浮动效果
		if (scrolls > idmainoffsettop_top && ComparePageObject.ValidCount > 0) {//如果向上滚动大于id的top位置
			floatkey = true; //开启浮动模式
			if (!ComparePageObject.IsShowFloatTop) {
				ComparePageObject.IsShowFloatTop = true;
				changeWhenFloatTop();
			}
			if (window.XMLHttpRequest) {//非IE6						 	
				theid.css({ position: "fixed", top: "0", left: boxoffsetLeft, display: "block" });
			} else {//IE6				 
				theid.css({ position: "absolute", top: scrolls, left: boxoffsetLeft, display: "block" });
			}
		}
		else if (scrolls <= idmainoffsettop_top) {//如果向上滚动小于id的top位置
			floatkey = false; //关闭浮动模式。
			if (ComparePageObject.IsShowFloatTop) {
				ComparePageObject.IsShowFloatTop = false;
				changeWhenFloatTop();
			}
			theid.css({ position: "relative", left: "0", top: 0, display: "none" });

		}
		/////////////////////控制左右卷动屏幕的效果	
		if (floatkey) {//如果处在浮动状态
			if (scrollsLeft > 0 && boxoffsetLeft > 0) {//有左滚动，窗口大于页面宽度
				if (window.XMLHttpRequest) {	//非IE6	
					theid.css({
						left: boxoffsetLeft - scrollsLeft
					});
				} else {//IE6
					theid.css({
						left: boxoffsetLeft
					});
				}
			}
			if (scrollsLeft > 0 && boxoffsetLeft == 0) {//有左滚动，窗口小于页面宽度
				if (window.XMLHttpRequest) {	//非IE6					
					theid.css({
						left: -scrollsLeft
					});
				} else {//IE6
					theid.css({
						left: boxoffsetLeft
					});
				}
			}
			if (scrollsLeft == 0) {//无左滚动，窗口小于或者大于页面宽度。或者拉到最左边。
				theid.css({
					left: boxoffsetLeft //left数值等于id原有的offsetleft
				});
			}
		}
	});
	///////////////////////屏幕卷动结束
});

// page method --------------------------
var arrField = [
   { sType: "fieldPic", sFieldIndex: "", sFieldTitle: "图片", sPid: "", sTrPrefix: "1", unit: "", joinCode: "" },
   { sType: "bar", sFieldIndex: "", sFieldTitle: "基本信息", sPid: "", sTrPrefix: "1", unit: "", joinCode: "", scrollId: "params-carinfo" },
   { sType: "fieldPara", sFieldIndex: "0", sFieldTitle: "厂家指导价", sPid: "", sTrPrefix: "1", unit: "", joinCode: "" },
   { sType: "fieldPrice", sFieldIndex: "1", sFieldTitle: "商家报价", sPid: "", sTrPrefix: "1", unit: "", joinCode: "" },
   { sType: "fieldPrice", sFieldIndex: "2", sFieldTitle: "降价优惠", sPid: "", sTrPrefix: "1", unit: "", joinCode: "" },
//{ sType: "fieldAvgPrice", sFieldIndex: "0", sFieldTitle: "参考成交价", sPid: "", sTrPrefix: "1", unit: "", joinCode: "" },
   {sType: "fieldPara", sFieldIndex: "3", sFieldTitle: "保修政策", sPid: "", sTrPrefix: "1", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "4", sFieldTitle: "车船税减免", sPid: "", sTrPrefix: "1", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "5", sFieldTitle: "排量", sPid: "785", sTrPrefix: "1", unit: "L", joinCode: "" },
   { sType: "fieldMulti", sFieldIndex: "6,7", sFieldTitle: "变速箱", sPid: "724,712", sTrPrefix: "1,1", unit: "挡,", joinCode: ", " },
{ sType: "fieldPara", sFieldIndex: "8", sFieldTitle: "市区工况油耗", sPid: "783", sTrPrefix: "1", unit: "L/100km", joinCode: "", isVantage: "1", size: "0" },
{ sType: "fieldPara", sFieldIndex: "9", sFieldTitle: "市郊工况油耗", sPid: "784", sTrPrefix: "1", unit: "L/100km", joinCode: "", isVantage: "1", size: "0" },
   { sType: "fieldPara", sFieldIndex: "10", sFieldTitle: "综合工况油耗", sPid: "782", sTrPrefix: "1", unit: "L/100km", joinCode: "", isVantage: "1", size: "0" },
   { sType: "fieldPara", sFieldIndex: "11", sFieldTitle: "网友油耗", sPid: "658", sTrPrefix: "1", unit: "L/100km", joinCode: "", isVantage: "1", size: "0" },
   { sType: "fieldPara", sFieldIndex: "12", sFieldTitle: "易车实测油耗", sPid: "788", sTrPrefix: "1", unit: "L/100km", joinCode: "", isVantage: "1", size: "0" },
   { sType: "fieldPara", sFieldIndex: "13", sFieldTitle: "官方0-100公里加速时间", sPid: "650", sTrPrefix: "1", unit: "s", joinCode: "", isVantage: "1", size: "0" },
   { sType: "fieldPara", sFieldIndex: "14", sFieldTitle: "易车实测0-100公里加速时间", sPid: "786", sTrPrefix: "1", unit: "s", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "15", sFieldTitle: "最高车速", sPid: "663", sTrPrefix: "1", unit: "km/h", joinCode: "", isVantage: "1", size: "1" },
{ sType: "fieldPara", sFieldIndex: "16", sFieldTitle: "乘员人数（含司机）", sPid: "665", sTrPrefix: "1", unit: "个", joinCode: "" },
 { sType: "bar", sFieldIndex: "", sFieldTitle: "车体", sPid: "", sTrPrefix: "3", unit: "", joinCode: "", scrollId: "params-carbody" },
 { sType: "fieldPara", sFieldIndex: "24", sFieldTitle: "车身颜色", sPid: "598", sTrPrefix: "2", unit: "", joinCode: "" },
 { sType: "fieldPara", sFieldIndex: "0", sFieldTitle: "车长", sPid: "588", sTrPrefix: "2", unit: "mm", joinCode: "", isVantage: "1", size: "1" },
   { sType: "fieldPara", sFieldIndex: "1", sFieldTitle: "车宽", sPid: "593", sTrPrefix: "2", unit: "mm", joinCode: "", isVantage: "1", size: "1" },
   { sType: "fieldPara", sFieldIndex: "2", sFieldTitle: "车高", sPid: "586", sTrPrefix: "2", unit: "mm", joinCode: "", isVantage: "1", size: "1" },
    { sType: "fieldPara", sFieldIndex: "3", sFieldTitle: "轴距", sPid: "592", sTrPrefix: "2", unit: "mm", joinCode: "", isVantage: "1", size: "1" },
   { sType: "fieldPara", sFieldIndex: "4", sFieldTitle: "前轮距", sPid: "585", sTrPrefix: "2", unit: "mm", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "5", sFieldTitle: "后轮距", sPid: "582", sTrPrefix: "2", unit: "mm", joinCode: "" },
    { sType: "fieldPara", sFieldIndex: "6", sFieldTitle: "整备质量", sPid: "669", sTrPrefix: "2", unit: "kg", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "7", sFieldTitle: "满载质量", sPid: "668", sTrPrefix: "2", unit: "kg", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "8", sFieldTitle: "最小离地间隙", sPid: "589", sTrPrefix: "2", unit: "mm", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "9", sFieldTitle: "最大涉水深度", sPid: "662", sTrPrefix: "2", unit: "mm", joinCode: "", isVantage: "1", size: "1" },
   { sType: "fieldPara", sFieldIndex: "10", sFieldTitle: "接近角", sPid: "591", sTrPrefix: "2", unit: "mm", joinCode: "", isVantage: "1", size: "1" },
   { sType: "fieldPara", sFieldIndex: "11", sFieldTitle: "通过角", sPid: "890", sTrPrefix: "2", unit: "mm", joinCode: "", isVantage: "1", size: "1" },
   { sType: "fieldPara", sFieldIndex: "12", sFieldTitle: "离去角", sPid: "581", sTrPrefix: "2", unit: "mm", joinCode: "", isVantage: "1", size: "1" },
   { sType: "fieldPara", sFieldIndex: "13", sFieldTitle: "行李箱容积", sPid: "465", sTrPrefix: "2", unit: "L", joinCode: "", isVantage: "1", size: "1" },
    { sType: "fieldPara", sFieldIndex: "14", sFieldTitle: "行李箱最大拓展容积", sPid: "466", sTrPrefix: "2", unit: "L", joinCode: "", isVantage: "1", size: "1" },
{ sType: "fieldPara", sFieldIndex: "15", sFieldTitle: "行李箱盖开合方式", sPid: "466", sTrPrefix: "2", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "16", sFieldTitle: "行李箱打开方式", sPid: "441", sTrPrefix: "2", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "17", sFieldTitle: "车门数", sPid: "563", sTrPrefix: "2", unit: "个", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "18", sFieldTitle: "车顶型式", sPid: "573", sTrPrefix: "2", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "19", sFieldTitle: "车篷型式", sPid: "570", sTrPrefix: "2", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "20", sFieldTitle: "车顶行李箱架", sPid: "627", sTrPrefix: "2", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "21", sFieldTitle: "后导流尾翼", sPid: "616", sTrPrefix: "2", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "22", sFieldTitle: "运动包围", sPid: "597", sTrPrefix: "2", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "23", sFieldTitle: "风阻系数", sPid: "670", sTrPrefix: "2", unit: "", joinCode: "", isVantage: "1", size: "0" },
 { sType: "bar", sFieldIndex: "", sFieldTitle: "发动机", sPid: "", sTrPrefix: "3", unit: "", joinCode: "", scrollId: "params-carengine" },
 { sType: "fieldPara", sFieldIndex: "0", sFieldTitle: "发动机位置", sPid: "428", sTrPrefix: "3", unit: "", joinCode: "" },
 { sType: "fieldPara", sFieldIndex: "1", sFieldTitle: "发动机型号", sPid: "436", sTrPrefix: "3", unit: "", joinCode: "" },
 { sType: "fieldPara", sFieldIndex: "2", sFieldTitle: "排量", sPid: "785", sTrPrefix: "3", unit: "L", joinCode: "" },
 { sType: "fieldPara", sFieldIndex: "3", sFieldTitle: "排量", sPid: "423", sTrPrefix: "3", unit: "mL", joinCode: "" },
 { sType: "fieldMulti", sFieldIndex: "4,5", sFieldTitle: "进气形式", sPid: "425,408", sTrPrefix: "3,3", unit: " ,", joinCode: "," },
 { sType: "fieldPara", sFieldIndex: "6", sFieldTitle: "气缸排列型式", sPid: "418", sTrPrefix: "3", unit: "", joinCode: "" },
 { sType: "fieldPara", sFieldIndex: "7", sFieldTitle: "汽缸数", sPid: "417", sTrPrefix: "3", unit: "个", joinCode: "" },
 { sType: "fieldPara", sFieldIndex: "8", sFieldTitle: "每缸气门数", sPid: "437", sTrPrefix: "3", unit: "个", joinCode: "" },
  { sType: "fieldPara", sFieldIndex: "9", sFieldTitle: "气门结构", sPid: "410", sTrPrefix: "3", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "10", sFieldTitle: "压缩比", sPid: "414", sTrPrefix: "3", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "11", sFieldTitle: "缸径", sPid: "415", sTrPrefix: "3", unit: "mm", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "12", sFieldTitle: "行程", sPid: "434", sTrPrefix: "3", unit: "mm", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "13", sFieldTitle: "最大马力", sPid: "791", sTrPrefix: "3", unit: "Ps", joinCode: "", isVantage: "1", size: "1" },
   { sType: "fieldPara", sFieldIndex: "14", sFieldTitle: "最大功率", sPid: "430", sTrPrefix: "3", unit: "kW", joinCode: "", isVantage: "1", size: "1" },
   { sType: "fieldPara", sFieldIndex: "15", sFieldTitle: "最大功率转速", sPid: "433", sTrPrefix: "3", unit: "rpm", joinCode: "", isVantage: "1", size: "1" },
    { sType: "fieldPara", sFieldIndex: "16", sFieldTitle: "最大扭矩", sPid: "429", sTrPrefix: "3", unit: "N·m", joinCode: "", isVantage: "1", size: "1" },
	{ sType: "fieldPara", sFieldIndex: "17", sFieldTitle: "最大扭矩转速", sPid: "432", sTrPrefix: "3", unit: "rpm", joinCode: "", isVantage: "1", size: "1" },
 	{ sType: "fieldPara", sFieldIndex: "18", sFieldTitle: "特有技术", sPid: "435", sTrPrefix: "3", unit: "", joinCode: "" },
	{ sType: "fieldPara", sFieldIndex: "19", sFieldTitle: "燃料类型", sPid: "578", sTrPrefix: "3", unit: "", joinCode: "" },
	{ sType: "fieldPara", sFieldIndex: "20", sFieldTitle: "燃油标号", sPid: "577", sTrPrefix: "3", unit: "", joinCode: "" },
	 { sType: "fieldPara", sFieldIndex: "21", sFieldTitle: "供油方式", sPid: "580", sTrPrefix: "3", unit: "", joinCode: "" },
	 { sType: "fieldPara", sFieldIndex: "22", sFieldTitle: "燃油箱容积", sPid: "576", sTrPrefix: "3", unit: "L", joinCode: "", isVantage: "1", size: "1" },
 { sType: "fieldPara", sFieldIndex: "23", sFieldTitle: "缸盖材料", sPid: "419", sTrPrefix: "3", unit: "", joinCode: "" },
 { sType: "fieldPara", sFieldIndex: "24", sFieldTitle: "缸体材料", sPid: "416", sTrPrefix: "3", unit: "", joinCode: "" },
  { sType: "fieldPara", sFieldIndex: "25", sFieldTitle: "环保标准", sPid: "421", sTrPrefix: "3", unit: "", joinCode: "" },
  { sType: "fieldPara", sFieldIndex: "26", sFieldTitle: "启停系统", sPid: "894", sTrPrefix: "3", unit: "", joinCode: "" },
//{ sType: "fieldPara", sFieldIndex: "27", sFieldTitle: "电机最大功率-转速", sPid: "871", sTrPrefix: "3", unit: "kW/rpm", joinCode: "" },
//{ sType: "fieldPara", sFieldIndex: "28", sFieldTitle: "电机最大扭矩-转速", sPid: "873", sTrPrefix: "3", unit: "N·m/rpm", joinCode: "" },

	{sType: "bar", sFieldIndex: "", sFieldTitle: "电池/电动机", sPid: "", sTrPrefix: "16", unit: "", joinCode: "", scrollId: "params-electric" },
	 { sType: "fieldPara", sFieldIndex: "0", sFieldTitle: "电机最大功率", sPid: "870", sTrPrefix: "16", unit: "kW", joinCode: "", isVantage: "1", size: "1" },
	 { sType: "fieldPara", sFieldIndex: "27", sFieldTitle: "电机最大功率-转速", sPid: "871", sTrPrefix: "3", unit: "kW/rpm", joinCode: "" },
	 { sType: "fieldPara", sFieldIndex: "1", sFieldTitle: "电机最大扭矩", sPid: "872", sTrPrefix: "16", unit: "N.m", joinCode: "", isVantage: "1", size: "1" },
	 { sType: "fieldPara", sFieldIndex: "28", sFieldTitle: "电机最大扭矩-转速", sPid: "873", sTrPrefix: "3", unit: "N·m/rpm", joinCode: "" },
	 { sType: "fieldPara", sFieldIndex: "3", sFieldTitle: "电机额定功率", sPid: "869", sTrPrefix: "16", unit: "kW", joinCode: "", isVantage: "1", size: "1" },
	 { sType: "fieldPara", sFieldIndex: "2", sFieldTitle: "系统电压", sPid: "874", sTrPrefix: "16", unit: "V", joinCode: "" },
	 { sType: "fieldPara", sFieldIndex: "4", sFieldTitle: "电机类型", sPid: "866", sTrPrefix: "16", unit: "", joinCode: "" },
	 { sType: "fieldPara", sFieldIndex: "5", sFieldTitle: "普通充电时间", sPid: "879", sTrPrefix: "16", unit: "分钟", joinCode: "", isVantage: "1", size: "0" },
	 { sType: "fieldPara", sFieldIndex: "6", sFieldTitle: "快速充电时间", sPid: "878", sTrPrefix: "16", unit: "分钟", joinCode: "", isVantage: "1", size: "0" },
	 { sType: "fieldPara", sFieldIndex: "7", sFieldTitle: "电池电压", sPid: "877", sTrPrefix: "16", unit: "V", joinCode: "" },
	 { sType: "fieldPara", sFieldIndex: "8", sFieldTitle: "电池容量", sPid: "876", sTrPrefix: "16", unit: "Ah", joinCode: "", isVantage: "1", size: "1" },
	 { sType: "fieldPara", sFieldIndex: "9", sFieldTitle: "电池类型", sPid: "875", sTrPrefix: "16", unit: "", joinCode: "" },
	 { sType: "fieldPara", sFieldIndex: "10", sFieldTitle: "百公里耗电量", sPid: "868", sTrPrefix: "16", unit: "kw/100km", joinCode: "", isVantage: "1", size: "0" },

	 { sType: "bar", sFieldIndex: "", sFieldTitle: "变速箱", sPid: "", sTrPrefix: "4", unit: "", joinCode: "", scrollId: "params-transmission" },
	 { sType: "fieldMulti", sFieldIndex: "1,0", sFieldTitle: "变速箱", sPid: "724,712", sTrPrefix: "4,4", unit: "挡,", joinCode: ", " },
	 { sType: "fieldPara", sFieldIndex: "2", sFieldTitle: "换挡拨片", sPid: "547", sTrPrefix: "4", unit: "", joinCode: "" },
 	 { sType: "fieldPara", sFieldIndex: "3", sFieldTitle: "电子档杆", sPid: "844", sTrPrefix: "4", unit: "", joinCode: "" },
	 { sType: "bar", sFieldIndex: "", sFieldTitle: "底盘制动", sPid: "", sTrPrefix: "5", unit: "", joinCode: "", scrollId: "params-bottomstop" },
	 { sType: "fieldPara", sFieldIndex: "0", sFieldTitle: "车体结构", sPid: "844", sTrPrefix: "5", unit: "", joinCode: "" },
	 { sType: "fieldPara", sFieldIndex: "1", sFieldTitle: "最小转弯半径", sPid: "590", sTrPrefix: "5", unit: "m", joinCode: "" },
	 { sType: "fieldPara", sFieldIndex: "2", sFieldTitle: "转向助力", sPid: "735", sTrPrefix: "5", unit: "", joinCode: "" },
	 { sType: "fieldPara", sFieldIndex: "3", sFieldTitle: "前制动类型", sPid: "726", sTrPrefix: "5", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "4", sFieldTitle: "后制动类型", sPid: "718", sTrPrefix: "5", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "5", sFieldTitle: "驻车制动类型", sPid: "716", sTrPrefix: "5", unit: "", joinCode: "" },
    { sType: "fieldPara", sFieldIndex: "6", sFieldTitle: "驱动方式", sPid: "655", sTrPrefix: "5", unit: "", joinCode: "" },
	{ sType: "fieldPara", sFieldIndex: "7", sFieldTitle: "空气悬挂", sPid: "814", sTrPrefix: "5", unit: "", joinCode: "" },
	{ sType: "fieldPara", sFieldIndex: "8", sFieldTitle: "可调悬挂", sPid: "708", sTrPrefix: "5", unit: "", joinCode: "" },
	{ sType: "fieldPara", sFieldIndex: "9", sFieldTitle: "前悬挂类型", sPid: "728", sTrPrefix: "5", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "10", sFieldTitle: "后悬挂类型", sPid: "720", sTrPrefix: "5", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "11", sFieldTitle: "中央差速器锁", sPid: "733", sTrPrefix: "5", unit: "", joinCode: "" },
   { sType: "bar", sFieldIndex: "", sFieldTitle: "安全配置", sPid: "", sTrPrefix: "6", unit: "", joinCode: "", scrollId: "params-safeconfig" },
   { sType: "fieldPara", sFieldIndex: "0", sFieldTitle: "驾驶位安全气囊", sPid: "682", sTrPrefix: "6", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "1", sFieldTitle: "副驾驶位安全气囊", sPid: "697", sTrPrefix: "6", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "2", sFieldTitle: "前排侧安全气囊", sPid: "691", sTrPrefix: "6", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "3", sFieldTitle: "前排头部气囊(气帘)", sPid: "690", sTrPrefix: "6", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "4", sFieldTitle: "膝部气囊", sPid: "835", sTrPrefix: "6", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "5", sFieldTitle: "后排侧安全气囊", sPid: "680", sTrPrefix: "6", unit: "", joinCode: "" },
    { sType: "fieldPara", sFieldIndex: "6", sFieldTitle: "后排头部气囊(气帘)", sPid: "679", sTrPrefix: "6", unit: "", joinCode: "" },
	 { sType: "fieldPara", sFieldIndex: "7", sFieldTitle: "安全带气囊", sPid: "845", sTrPrefix: "6", unit: "", joinCode: "" },
	 { sType: "fieldPara", sFieldIndex: "8", sFieldTitle: "安全带未系提示", sPid: "836", sTrPrefix: "6", unit: "", joinCode: "" },
	  { sType: "fieldPara", sFieldIndex: "9", sFieldTitle: "安全带限力功能", sPid: "701", sTrPrefix: "6", unit: "", joinCode: "" },
	  { sType: "fieldPara", sFieldIndex: "10", sFieldTitle: "安全带预收紧功能", sPid: "678", sTrPrefix: "6", unit: "", joinCode: "" },
	  { sType: "fieldPara", sFieldIndex: "11", sFieldTitle: "前安全带调节", sPid: "677", sTrPrefix: "6", unit: "", joinCode: "" },
	  { sType: "fieldPara", sFieldIndex: "12", sFieldTitle: "后排安全带", sPid: "675", sTrPrefix: "6", unit: "", joinCode: "" },
	  { sType: "fieldPara", sFieldIndex: "13", sFieldTitle: "后排中间三点式安全带", sPid: "676", sTrPrefix: "6", unit: "", joinCode: "" },
	  { sType: "fieldPara", sFieldIndex: "14", sFieldTitle: "电子限速", sPid: "656", sTrPrefix: "6", unit: "", joinCode: "" },
	   { sType: "fieldPara", sFieldIndex: "15", sFieldTitle: "胎压监测装置", sPid: "714", sTrPrefix: "6", unit: "", joinCode: "" },
	   { sType: "fieldPara", sFieldIndex: "16", sFieldTitle: "零压续行(零胎压继续行驶)", sPid: "715", sTrPrefix: "6", unit: "", joinCode: "" },
	   { sType: "fieldPara", sFieldIndex: "17", sFieldTitle: "可溃缩转向柱", sPid: "713", sTrPrefix: "6", unit: "", joinCode: "" },
	   { sType: "fieldPara", sFieldIndex: "18", sFieldTitle: "溃缩式制动踏板", sPid: "696", sTrPrefix: "6", unit: "", joinCode: "" },
	   { sType: "fieldPara", sFieldIndex: "19", sFieldTitle: "车内中控锁", sPid: "837", sTrPrefix: "6", unit: "", joinCode: "" },
	   { sType: "fieldPara", sFieldIndex: "20", sFieldTitle: "中控门锁", sPid: "493", sTrPrefix: "6", unit: "", joinCode: "" },
	   { sType: "fieldPara", sFieldIndex: "21", sFieldTitle: "儿童锁", sPid: "494", sTrPrefix: "6", unit: "", joinCode: "" },
	   { sType: "fieldPara", sFieldIndex: "22", sFieldTitle: "遥控钥匙", sPid: "538", sTrPrefix: "6", unit: "", joinCode: "" },
	   { sType: "fieldPara", sFieldIndex: "23", sFieldTitle: "无钥匙启动系统", sPid: "469", sTrPrefix: "6", unit: "", joinCode: "" },
	   { sType: "fieldMulti", sFieldIndex: "24,25", sFieldTitle: "发动机电子防盗", sPid: "699,683", sTrPrefix: "6,6", unit: "", joinCode: "" },
		{ sType: "bar", sFieldIndex: "", sFieldTitle: "车轮", sPid: "", sTrPrefix: "7", unit: "", joinCode: "", scrollId: "params-wheel" },
{ sType: "fieldPara", sFieldIndex: "0", sFieldTitle: "前轮胎规格", sPid: "729", sTrPrefix: "7", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "1", sFieldTitle: "后轮胎规格", sPid: "721", sTrPrefix: "7", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "2", sFieldTitle: "前轮毂规格", sPid: "727", sTrPrefix: "7", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "3", sFieldTitle: "后轮毂规格", sPid: "719", sTrPrefix: "7", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "4", sFieldTitle: "备胎类型", sPid: "707", sTrPrefix: "7", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "5", sFieldTitle: "轮毂材料", sPid: "704", sTrPrefix: "7", unit: "", joinCode: "" },
{ sType: "bar", sFieldIndex: "", sFieldTitle: "行车辅助", sPid: "", sTrPrefix: "8", unit: "", joinCode: "", scrollId: "params-drivingassistance" },
{ sType: "fieldPara", sFieldIndex: "0", sFieldTitle: "刹车防抱死(ABS)", sPid: "673", sTrPrefix: "8", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "1", sFieldTitle: "电子制动力分配系统(EBD)", sPid: "685", sTrPrefix: "8", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "2", sFieldTitle: "刹车辅助(EBA/BAS/BA/EVA等)", sPid: "684", sTrPrefix: "8", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "3", sFieldTitle: "牵引力控制(ASR/TCS/TRC/ATC等)", sPid: "698", sTrPrefix: "8", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "4", sFieldTitle: "动态稳定控制系统（ESP）", sPid: "700", sTrPrefix: "8", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "5", sFieldTitle: "随速助力转向调节(EPS)", sPid: "732", sTrPrefix: "8", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "6", sFieldTitle: "自动驻车", sPid: "811", sTrPrefix: "8", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "7", sFieldTitle: "上坡辅助", sPid: "812", sTrPrefix: "8", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "8", sFieldTitle: "陡坡缓降", sPid: "813", sTrPrefix: "8", unit: "", joinCode: "" },
 { sType: "fieldPara", sFieldIndex: "9", sFieldTitle: "泊车雷达(车前)", sPid: "800", sTrPrefix: "8", unit: "", joinCode: "" },
 { sType: "fieldPara", sFieldIndex: "10", sFieldTitle: "倒车雷达(车后)", sPid: "702", sTrPrefix: "8", unit: "", joinCode: "" },
 { sType: "fieldPara", sFieldIndex: "11", sFieldTitle: "倒车影像", sPid: "703", sTrPrefix: "8", unit: "", joinCode: "" },
 { sType: "fieldPara", sFieldIndex: "12", sFieldTitle: "全景摄像头", sPid: "820", sTrPrefix: "8", unit: "", joinCode: "" },
 { sType: "fieldPara", sFieldIndex: "13", sFieldTitle: "定速巡航", sPid: "545", sTrPrefix: "8", unit: "", joinCode: "" },
 { sType: "fieldPara", sFieldIndex: "14", sFieldTitle: "自适应巡航", sPid: "893", sTrPrefix: "8", unit: "", joinCode: "" },
 { sType: "fieldPara", sFieldIndex: "15", sFieldTitle: "GPS导航系统", sPid: "516", sTrPrefix: "8", unit: "", joinCode: "" },
 { sType: "fieldPara", sFieldIndex: "16", sFieldTitle: "人机交互系统", sPid: "806", sTrPrefix: "8", unit: "", joinCode: "" },
 { sType: "fieldPara", sFieldIndex: "17", sFieldTitle: "自动泊车入位", sPid: "816", sTrPrefix: "8", unit: "", joinCode: "" },
 { sType: "fieldPara", sFieldIndex: "18", sFieldTitle: "并线辅助", sPid: "817", sTrPrefix: "8", unit: "", joinCode: "" },
  { sType: "fieldPara", sFieldIndex: "19", sFieldTitle: "主动刹车/主动安全系统", sPid: "818", sTrPrefix: "8", unit: "", joinCode: "" },
  { sType: "fieldPara", sFieldIndex: "20", sFieldTitle: "整体主动转向系统", sPid: "841", sTrPrefix: "8", unit: "", joinCode: "" },
  { sType: "fieldPara", sFieldIndex: "21", sFieldTitle: "夜视系统", sPid: "819", sTrPrefix: "8", unit: "", joinCode: "" },
  { sType: "fieldPara", sFieldIndex: "22", sFieldTitle: "盲点检测", sPid: "898", sTrPrefix: "8", unit: "", joinCode: "" },
  { sType: "fieldPara", sFieldIndex: "23", sFieldTitle: "发动机阻力矩控制系统（EDC/MSR）", sPid: "897", sTrPrefix: "8", unit: "", joinCode: "" },
  { sType: "fieldPara", sFieldIndex: "24", sFieldTitle: "弯道制动控制系统（CBC）", sPid: "896", sTrPrefix: "8", unit: "", joinCode: "" },
  { sType: "bar", sFieldIndex: "", sFieldTitle: "门窗/后视镜", sPid: "", sTrPrefix: "9", unit: "", joinCode: "", scrollId: "params-doorswindow" },
  { sType: "fieldPara", sFieldIndex: "0", sFieldTitle: "开门方式", sPid: "891", sTrPrefix: "9", unit: "", joinCode: "" },
  { sType: "fieldPara", sFieldIndex: "1", sFieldTitle: "电动车窗", sPid: "601", sTrPrefix: "9", unit: "", joinCode: "" },
  { sType: "fieldPara", sFieldIndex: "2", sFieldTitle: "防紫外线/隔热玻璃", sPid: "796", sTrPrefix: "9", unit: "", joinCode: "" },
  { sType: "fieldPara", sFieldIndex: "3", sFieldTitle: "电动窗防夹功能", sPid: "594", sTrPrefix: "9", unit: "", joinCode: "" },
  { sType: "fieldPara", sFieldIndex: "4", sFieldTitle: "天窗开合方式", sPid: "568", sTrPrefix: "9", unit: "", joinCode: "" },
  { sType: "fieldPara", sFieldIndex: "5", sFieldTitle: "天窗型式", sPid: "567", sTrPrefix: "9", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "6", sFieldTitle: "后窗遮阳帘", sPid: "595", sTrPrefix: "9", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "7", sFieldTitle: "后排侧遮阳帘", sPid: "797", sTrPrefix: "9", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "8", sFieldTitle: "后雨刷器", sPid: "596", sTrPrefix: "9", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "9", sFieldTitle: "感应雨刷", sPid: "606", sTrPrefix: "9", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "10", sFieldTitle: "电动吸合门", sPid: "821", sTrPrefix: "9", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "11", sFieldTitle: "行李箱电动吸合门", sPid: "822", sTrPrefix: "9", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "12", sFieldTitle: "后视镜带侧转向灯", sPid: "830", sTrPrefix: "9", unit: "", joinCode: "" },
   { sType: "fieldPara", sFieldIndex: "13", sFieldTitle: "外后视镜记忆功能	", sPid: "625", sTrPrefix: "9", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "14", sFieldTitle: "外后视镜加热功能", sPid: "624", sTrPrefix: "9", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "15", sFieldTitle: "外后视镜电动折叠功能", sPid: "623", sTrPrefix: "9", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "16", sFieldTitle: "外后视镜电动调节", sPid: "622", sTrPrefix: "9", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "17", sFieldTitle: "内后视镜防眩目功能", sPid: "621", sTrPrefix: "9", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "18", sFieldTitle: "遮阳板化妆镜", sPid: "512", sTrPrefix: "9", unit: "", joinCode: "" },
{ sType: "bar", sFieldIndex: "", sFieldTitle: "灯光", sPid: "", sTrPrefix: "10", unit: "", joinCode: "", scrollId: "params-lights" },
{ sType: "fieldPara", sFieldIndex: "0", sFieldTitle: "前照灯类型", sPid: "614", sTrPrefix: "10", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "1", sFieldTitle: "前大灯自动开闭", sPid: " 609", sTrPrefix: "10", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "2", sFieldTitle: "前照灯自动清洗功能", sPid: "608", sTrPrefix: "10", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "3", sFieldTitle: "前大灯延时关闭", sPid: " 611", sTrPrefix: "10", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "4", sFieldTitle: "前大灯随动转向", sPid: " 613", sTrPrefix: "10", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "5", sFieldTitle: "前照灯照射范围调整", sPid: " 612", sTrPrefix: "10", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "6", sFieldTitle: "会车前灯防眩目功能", sPid: " 610", sTrPrefix: "10", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "7", sFieldTitle: "前雾灯", sPid: "607", sTrPrefix: "10", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "8", sFieldTitle: "车厢前阅读灯", sPid: "539", sTrPrefix: "10", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "9", sFieldTitle: "车厢后阅读灯", sPid: "480", sTrPrefix: "10", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "10", sFieldTitle: "车内氛围灯", sPid: "795", sTrPrefix: "10", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "11", sFieldTitle: "日间行车灯", sPid: "794", sTrPrefix: "10", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "12", sFieldTitle: "LED尾灯", sPid: " 846", sTrPrefix: "10", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "13", sFieldTitle: "高位（第三）制动灯", sPid: " 620", sTrPrefix: "10", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "14", sFieldTitle: "转向头灯（辅助灯）", sPid: " 828", sTrPrefix: "10", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "15", sFieldTitle: "侧转向灯", sPid: "626", sTrPrefix: "10", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "16", sFieldTitle: "行李箱灯", sPid: "618", sTrPrefix: "10", unit: "", joinCode: "" },
{ sType: "bar", sFieldIndex: "", sFieldTitle: "内部配置", sPid: "", sTrPrefix: "11", unit: "", joinCode: "", scrollId: "params-innerconfig" },
{ sType: "fieldPara", sFieldIndex: "0", sFieldTitle: "方向盘前后调节", sPid: "799", sTrPrefix: "11", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "1", sFieldTitle: "方向盘上下调节", sPid: "798", sTrPrefix: "11", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "2", sFieldTitle: "方向盘调节方式", sPid: "552", sTrPrefix: "11", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "3", sFieldTitle: "方向盘记忆设置", sPid: "549", sTrPrefix: "11", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "4", sFieldTitle: "方向盘表面材料", sPid: "548", sTrPrefix: "11", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "5", sFieldTitle: "多功能方向盘", sPid: "528", sTrPrefix: "11", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "6", sFieldTitle: "多功能方向盘功能", sPid: "527", sTrPrefix: "11", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "7", sFieldTitle: "行车电脑显示屏", sPid: "832", sTrPrefix: "11", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "8", sFieldTitle: "HUD抬头数字显示", sPid: "518", sTrPrefix: "11", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "9", sFieldTitle: "内饰颜色", sPid: "801", sTrPrefix: "11", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "10", sFieldTitle: "后排杯架", sPid: "474", sTrPrefix: "11", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "11", sFieldTitle: "车内电源电压", sPid: "467", sTrPrefix: "11", unit: "", joinCode: "" },
{ sType: "bar", sFieldIndex: "", sFieldTitle: "座椅", sPid: "", sTrPrefix: "12", unit: "", joinCode: "", scrollId: "params-chair" },
{ sType: "fieldPara", sFieldIndex: "0", sFieldTitle: "运动座椅", sPid: "546", sTrPrefix: "12", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "1", sFieldTitle: "座椅材料", sPid: "544", sTrPrefix: "12", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "2", sFieldTitle: "驾驶座座椅调节方式", sPid: "508", sTrPrefix: "12", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "3", sFieldTitle: "驾驶座座椅调节方向", sPid: "507", sTrPrefix: "12", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "4", sFieldTitle: "副驾驶座椅调节方式", sPid: "503", sTrPrefix: "12", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "5", sFieldTitle: "副驾驶座椅调节方向", sPid: "502", sTrPrefix: "12", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "6", sFieldTitle: "驾驶座腰部支撑调节", sPid: "506", sTrPrefix: "12", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "7", sFieldTitle: "驾驶座肩部支撑调节", sPid: "802", sTrPrefix: "12", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "8", sFieldTitle: "前座椅头枕调节", sPid: "515", sTrPrefix: "12", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "9", sFieldTitle: "后排座椅调节方式", sPid: "833", sTrPrefix: "12", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "10", sFieldTitle: "后排座位放倒比例", sPid: "482", sTrPrefix: "12", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "11", sFieldTitle: "前座中央扶手", sPid: "514", sTrPrefix: "12", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "12", sFieldTitle: "后座中央扶手", sPid: "475", sTrPrefix: "12", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "13", sFieldTitle: "座椅通风", sPid: "804", sTrPrefix: "12", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "14", sFieldTitle: "座椅加热", sPid: "504", sTrPrefix: "12", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "15", sFieldTitle: "座椅按摩功能", sPid: "543", sTrPrefix: "12", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "16", sFieldTitle: "电动座椅记忆", sPid: "803", sTrPrefix: "12", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "17", sFieldTitle: "儿童安全座椅固定装置", sPid: "495", sTrPrefix: "12", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "18", sFieldTitle: "第三排座椅", sPid: "805", sTrPrefix: "12", unit: "", joinCode: "" },
{ sType: "bar", sFieldIndex: "", sFieldTitle: "娱乐通讯", sPid: "", sTrPrefix: "13", unit: "", joinCode: "", scrollId: "params-pastime" },
{ sType: "fieldPara", sFieldIndex: "0", sFieldTitle: "车载电话", sPid: "554", sTrPrefix: "13", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "1", sFieldTitle: "蓝牙系统", sPid: "479", sTrPrefix: "13", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "2", sFieldTitle: "外接音源接口", sPid: "810", sTrPrefix: "13", unit: "", joinCode: "" },
{ sType: "fieldMulti", sFieldIndex: "4,3", sFieldTitle: "内置硬盘", sPid: "807,808", sTrPrefix: "13,13", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "5", sFieldTitle: "车载电视", sPid: "559", sTrPrefix: "13", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "6", sFieldTitle: "扬声器数量", sPid: "523", sTrPrefix: "13", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "7", sFieldTitle: "音响品牌", sPid: "473", sTrPrefix: "13", unit: "", joinCode: "" },
{ sType: "fieldMulti", sFieldIndex: "8,9", sFieldTitle: "DVD", sPid: "510,509", sTrPrefix: "13,13", unit: ",碟", joinCode: "" },
{ sType: "fieldMulti", sFieldIndex: "10,11", sFieldTitle: "CD", sPid: "490,489", sTrPrefix: "13,13", unit: ",碟", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "12", sFieldTitle: "中控台液晶屏", sPid: "488", sTrPrefix: "13", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "13", sFieldTitle: "后排液晶屏", sPid: "477", sTrPrefix: "13", unit: "", joinCode: "" },
{ sType: "bar", sFieldIndex: "", sFieldTitle: "空调/冰箱", sPid: "", sTrPrefix: "15", unit: "", joinCode: "", scrollId: "params-air" },
{ sType: "fieldPara", sFieldIndex: "0", sFieldTitle: "空调控制方式", sPid: "471", sTrPrefix: "15", unit: "", joinCode: "" },
{ sType: "fieldMulti", sFieldIndex: "1,2", sFieldTitle: "温度分区控制", sPid: "839,555", sTrPrefix: "15,15", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "3", sFieldTitle: "后排独立空调", sPid: "838", sTrPrefix: "15", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "4", sFieldTitle: "后排出风口", sPid: "478", sTrPrefix: "15", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "5", sFieldTitle: "空气调节/花粉过滤", sPid: "840", sTrPrefix: "15", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "6", sFieldTitle: "车内空气净化装置", sPid: "905", sTrPrefix: "15", unit: "", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "7", sFieldTitle: "车载冰箱", sPid: "485", sTrPrefix: "15", unit: "", joinCode: "" },
{ sType: "bar", sFieldIndex: "", sFieldTitle: "易车测试", sPid: "", sTrPrefix: "14", unit: "", joinCode: "", scrollId: "params-test" },
{ sType: "fieldPara", sFieldIndex: "0", sFieldTitle: "加速时间（0—100km/h）", sPid: "786", sTrPrefix: "14", unit: "s", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "1", sFieldTitle: "制动距离（100—0km/h）", sPid: "787", sTrPrefix: "14", unit: "m", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "2", sFieldTitle: "油耗", sPid: "788", sTrPrefix: "14", unit: "L/100km", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "3", sFieldTitle: "18米绕桩速度", sPid: "861", sTrPrefix: "14", unit: "km/h", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "4", sFieldTitle: "车内怠速噪音dB(A)", sPid: "789", sTrPrefix: "14", unit: "dB", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "5", sFieldTitle: "车内等速（40km/h）噪音", sPid: "857", sTrPrefix: "14", unit: "dB", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "6", sFieldTitle: "车内等速（60km/h）噪音", sPid: "790", sTrPrefix: "14", unit: "dB", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "7", sFieldTitle: "车内等速（80km/h）噪音", sPid: "858", sTrPrefix: "14", unit: "dB", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "8", sFieldTitle: "车内等速（100km/h）噪音", sPid: "859", sTrPrefix: "14", unit: "dB", joinCode: "" },
{ sType: "fieldPara", sFieldIndex: "9", sFieldTitle: "车内等速（120km/h）噪音", sPid: "860", sTrPrefix: "14", unit: "dB", joinCode: "" },
   { sType: "bar", sFieldIndex: "", sFieldTitle: "更多信息", sTrPrefix: "14", unit: "", joinCode: "" },
   { sType: "fieldIndex", sFieldIndex: "0", sFieldTitle: "车型指数排名", sTrPrefix: "0", unit: "", joinCode: "" },
   { sType: "fieldOther", sFieldIndex: "11", sFieldTitle: "推荐阅读", sTrPrefix: "0", unit: "", joinCode: "" }
];
//元素居中
!function ($) {
	$.fn.showCenter = function () {
		var top = ($(window).height() - this.height()) / 2;
		var left = ($(window).width() - this.width()) / 2;
		var scrollTop = $(document).scrollTop();
		var scrollLeft = $(document).scrollLeft();

		if (ComparePageObject.IE6) {
			return this.css({ position: 'absolute', 'z-index': 1100, 'top': top + scrollTop, left: left + scrollLeft }).show();
		}
		else {
			return this.css({ position: 'fixed', 'z-index': 1100, 'top': "200px", left: left }).show();
		}
	}
} (jQuery);
//滚动监听
!function ($) {

	"use strict";

	function ScrollSpy(element, options) {
		var process = $.proxy(this.process, this)
		  , $element = $(element).is('body') ? $(window) : $(element)
		  , href;
		this.options = $.extend({}, $.fn.scrollspy.defaults, options);
		this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process);
		this.selector = (this.options.target) + ' li > a';
		this.$body = $('body');
		this.refresh();
		this.process();
	}

	ScrollSpy.prototype = {

		constructor: ScrollSpy

	  , refresh: function () {
	  	var self = this,
		$targets,
		scrollTop = self.$scrollElement.scrollTop();

	  	this.offsets = $([]);
	  	this.targets = $([]);

	  	$targets = this.$body
          .find(this.selector)
          .map(function (i, n) {
          	var $el = $(this),
			 targetName = $el.data('target'),
			 targetHeight = $el.height(),
			 $targetElement = $("#" + targetName);
          	if ($targetElement
              && ($targetElement.length > 0)) {
          		var ElementScrollTop = ($targetElement.offset().top + self.options.offset - (i * (targetHeight + 6)));
          		if (scrollTop >= ElementScrollTop) {
          			self.activate(targetName)
          		}
          		$el.unbind("click");
          		$el.bind("click", function (e) {
          			e.preventDefault();
          			$("html,body").animate({ scrollTop: ElementScrollTop + 1 }, 300, function () {
          				if (typeof self.options["callback"] != "undefined") { self.options["callback"](); }
          			});
          		});
          		return ([[ElementScrollTop, targetName]])
          	} else
          		return null;
          })
          .sort(function (a, b) { return a[0] - b[0] })
          .each(function () {
          	self.offsets.push(this[0])
          	self.targets.push(this[1])
          });
	  }

	  , process: function () {
	  	var scrollTop = this.$scrollElement.scrollTop()
          , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
          , maxScroll = scrollHeight - this.$scrollElement.height()
          , offsets = this.offsets
          , targets = this.targets
          , activeTarget = this.activeTarget
          , i;
	  	if (scrollTop >= maxScroll) {
	  		return activeTarget != (i = targets.last()[0])
			  && this.activate(i)
	  	}
	  	for (i = offsets.length; i--; ) {
	  		activeTarget != targets[i];
	  		if (scrollTop >= offsets[i] && (!offsets[i + 1] || scrollTop <= offsets[i + 1])) {
	  			this.activate(targets[i])
	  		}
	  	}
	  }

	  , activate: function (target) {

	  	this.activeTarget = target;

	  	$(this.selector)
          .parent('.current')
          .removeClass('current');

	  	var currSelector = this.selector + '[data-target="' + target + '"]';

	  	var active = $(currSelector)
          .parent('li')
          .addClass('current');

	  	active.trigger('activate');
	  }

	}

	var old = $.fn.scrollspy

	$.fn.scrollspy = function (option, callbackFunc) {
		if (callbackFunc && callbackFunc instanceof Function) option["callback"] = callbackFunc;
		return this.each(function () {
			var $this = $(this)
			  , data = $this.data('scrollspy')
			  , options = typeof option == 'object' && option
			if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
			if (typeof option == 'string') data[option]()
		})
	}

	$.fn.scrollspy.Constructor = ScrollSpy

	$.fn.scrollspy.defaults = {
		offset: 0,
		offsetList: 0
	}


	$.fn.scrollspy.noConflict = function () {
		$.fn.scrollspy = old
		return this
	}


	//	$(function () {
	//		$('[data-spy="scroll"]').each(function () {
	//			var $spy = $(this)
	//			$spy.scrollspy($spy.data())
	//		})
	//	})

} (jQuery);
//元素交换
!function ($) {
	$.fn.clickChange = function (opts) {
		var defaults = {
			speed: 200, //移动速度
			offset: 0
		}
		var option = $.extend(defaults, opts);

		var animateCallback = function (obj) {
			$(obj).remove();
		}

		this.each(function () {
			var _this = $(this);
			_this.on('click', '.change-car-area .btn-pre-car', function () {
				if (ComparePageObject.IsChange) return;
				ComparePageObject.IsChange = true;
				var parent = $(this).closest('.tableHead_item').find(".sel-car-move,div[id^='FloatTop_carBox_']").eq(0);
				var prevItem = $(this).closest('.tableHead_item').parent().prev().find(".sel-car-move,div[id^='FloatTop_carBox_']").eq(0);
				if (prevItem.length == 0) return;
				var index = parent.attr("id").replace("draggcarbox_", "").replace("FloatTop_carBox_", "");
				//ie6 7 没有动画效果
				//if (ComparePageObject.IE6 || ComparePageObject.IE7) {
				if (ComparePageObject.IsIE) {
					//标记可切换
					ComparePageObject.IsChange = false;
					if (index && option["leftCallback"]) {
						option["leftCallback"](index);
					}
					return;
				}

				var parentLeft = parent.position().left;
				var prevItemLeft = prevItem.position().left;
				parent.css('display', 'none');
				prevItem.css('display', 'none');
				var parentCloneElement = parent.clone();
				var prevCloneElement = prevItem.clone();

				parentCloneElement.insertAfter(parent).css({ position: 'absolute', display: 'block', 'z-index': '1000' }).animate({ left: parentLeft - 159 }, option.speed, function () {
					parent.insertBefore(prevCloneElement).css('display', 'block');
					animateCallback(prevCloneElement);
					//标记可切换
					ComparePageObject.IsChange = false;

					if (index && option["leftCallback"]) {
						option["leftCallback"](index);
					}
				});
				prevCloneElement.insertAfter(prevItem).css({ position: 'absolute', display: 'block', 'z-index': '999' }).animate({ left: parentLeft + 159 }, option.speed, function () {
					prevItem.insertBefore(parentCloneElement).css('display', 'block');
					animateCallback(parentCloneElement);
				});
			});
			_this.on('click', '.change-car-area .btn-next-car', function () {
				if (ComparePageObject.IsChange) return;
				ComparePageObject.IsChange = true;
				var parent = $(this).closest('.tableHead_item').find(".sel-car-move,div[id^='FloatTop_carBox_']").eq(0);
				var nextItem = $(this).closest('.tableHead_item').parent().next().find(".sel-car-move,div[id^='FloatTop_carBox_']").eq(0);
				var index = parent.attr("id").replace("draggcarbox_", "").replace("FloatTop_carBox_", "");
				if (nextItem.length == 0) return;

				//ie6 7 没有动画效果
				//if (ComparePageObject.IE6 || ComparePageObject.IE7) {
				if (ComparePageObject.IsIE) {
					//标记可切换
					ComparePageObject.IsChange = false;
					if (index && option["rightCallback"]) {
						option["rightCallback"](index);
					}
					return;
				}
				var parentLeft = parent.position().left;
				var nextItemLeft = nextItem.position().left;
				parent.css('display', 'none');
				nextItem.css('display', 'none');
				var parentCloneElement = parent.clone();
				var nextCloneElement = nextItem.clone();
				//alert(parentLeft);
				parentCloneElement.insertAfter(parent).css({ position: 'absolute', display: 'block', 'z-index': '1000' }).animate({ left: parentLeft + 159 }, option.speed, function () {
					parent.insertBefore(nextItem).css('display', 'block');
					animateCallback(nextCloneElement);
					//标记可切换
					ComparePageObject.IsChange = false;
					if (index && option["rightCallback"]) {
						option["rightCallback"](index);
					}
				});

				nextCloneElement.insertAfter(nextItem).css({ position: 'absolute', display: 'block', 'z-index': '999' }).animate({ left: nextItemLeft - 159 }, option.speed, function () {
					nextItem.insertBefore(parentCloneElement).css('display', 'block');
					animateCallback(parentCloneElement);
				});
			});
		});
	}
} (jQuery)